test:测试string是否包含有匹配结果,包含返回true,不包含返回false. <script type="text/javascript"> var str = "bbs.byr.cn"; var reg = /b/; var ret = reg.test(str); alert(ret); //true </script> match:根据pattern进行正则匹配,如果匹配到,返回匹配结果,如匹配不到返回null <scr…
http://plugins.jquery.com/?s=bootstrap 1. /reg/.test(strval) 2."strval".match(/reg/g), a reverse style of reg.exec, but when whether with g, exec result showed no difference. . with g, match as a whole, result: strval . without g, get all groups…