String Eail="[a-zA-Z0-9]{3,20}@[a-zA-Z0-9]{2,10}[.](com|cn|net)"; 中括号表示任意字符,花括号表示出现的次数,小括号表示出现的字符内容字符串。 if(emal.match(Emal)){ } 是否满足正则表达式给定的格式规范。 {3,5 ...
分类:
其他好文 时间:
2016-04-15 01:56:50
阅读次数:
150
mongoaggregate查询:db.collection.aggregate({
$group:{
_id:"$id",//"$_id"代表引用集合中_id列
max_value:{$max:"$times"}//"$times"代表引用集合中times列
},
$match:{times:{$gte:100}}
})相当于sql查询:select_id,max(times)
fromcollection
wheretimes>=100
分类:
数据库 时间:
2016-04-14 12:27:34
阅读次数:
712
理解自:http://www.cnblogs.com/vicenteforever/articles/1623137.html php手册中是这样解释的 matches 如果提供了参数matches,它将被填充为搜索结果。 $matches[0]将包含完整模式匹配到的文本, $matches[1] ...
分类:
Web程序 时间:
2016-04-14 12:04:02
阅读次数:
174
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android" xmlns:tools="http://schemas.android.com/tools" android:layout_width="match_pa ...
分类:
其他好文 时间:
2016-04-12 19:16:23
阅读次数:
120
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android" xmlns:tools="http://schemas.android.com/tools" android:layout_width="match_ ...
分类:
其他好文 时间:
2016-04-12 19:04:17
阅读次数:
141
JavaScript: 字符串作用与表达式 方法 描述说明 实例 String.match(regex) 针对字符串应用表达式,如果表达式失败返回null,否则返回匹配 var str=”the 90210 area code”; var pattern=/[0-9]{5}/; str.match( ...
分类:
其他好文 时间:
2016-04-11 22:03:40
阅读次数:
168
1.element.src.match("XX")表示如果src路径里面有XX匹配则为true 2.在HTML内直接写入js代码 注:每一句后面的分号不能少,双引号里面使用单引号 如果在a标签的href里面添加,要加上javascript:,例如 ...
分类:
编程语言 时间:
2016-04-11 20:32:31
阅读次数:
174
判断中文字符的字节长度 String.prototype.getBytes = function() { var chineseChar = this.match(/[^\x00-\xff]/g); return this.length += chineseChar ? chineseChar.le ...
分类:
编程语言 时间:
2016-04-11 18:46:07
阅读次数:
108
http://web.jobbole.com/85433/ @伯乐在线 - 燎原之火 在JavaScript代码中使用正则表达式进行模式匹配经常会用到String对象和RegExp对象的一些方法,例如replace、match、search等方法,以下是对一些方法使用的总结。 String对象中支持 ...
分类:
其他好文 时间:
2016-04-11 18:37:33
阅读次数:
162
1Python的数据结构: 1:序列: 列表(可改变) 元祖 (不可改变) 2:映射:字典 3:无序:集合 ASCII:八位 Unicode:16位 2Python的函数 abs:绝对值 match.sqrt:开方 match.ceil:上入 match.floor:下入 pow:幂 repr:字符 ...
分类:
编程语言 时间:
2016-04-10 01:13:31
阅读次数:
254