( ! ) Warning: include(): http:// wrapper is disabled in the server configuration by allow_url_include=0 in D:\www\up\js\regexp_use.php on line 14
Call Stack
#TimeMemoryFunctionLocation
10.0000356088{main}( )...\regexp_use.php:0

( ! ) Warning: include(http://pub.houheaven.com/Nav02/Nav_deep2.htm): failed to open stream: no suitable wrapper could be found in D:\www\up\js\regexp_use.php on line 14
Call Stack
#TimeMemoryFunctionLocation
10.0000356088{main}( )...\regexp_use.php:0

( ! ) Warning: include(): Failed opening 'http://pub.houheaven.com/Nav02/Nav_deep2.htm' for inclusion (include_path='.;C:\php\pear') in D:\www\up\js\regexp_use.php on line 14
Call Stack
#TimeMemoryFunctionLocation
10.0000356088{main}( )...\regexp_use.php:0

信息:原创2014-09-060 次阅读0 个评论

标签:后天堂向上,网站制作,自学教程,网站技术,javascript,JS正则表达式大全


正则表达式大全

下面的正则表达式都很常用,如果你觉得有更好的正则写法,我们可以一起交流下(企鹅:970012685)。

中文
正则写法/[\u4e00-\u9fa5]/
适用范围所有汉字
邮箱
正则写法/^\w+([-\.]\w+)*\@[A-Za-z0-9]+([-\.][A-Za-z0-9]+)*\.[A-Za-z]+$/
适用类型

一级域名:

  1. Eric@hh.com
  2. 1000@hh.com
  3. Eric2014@hh.com
  4. Eric-2014@hh.com
  5. Eric_2014@hh.com
  6. Eric.2014@hh.com

多级域名:

  1. Eric@hh.com
  2. Eric@test.hh.com
  3. Eric@mm-5.hh.com
  4. Eric@ser.mail.hh.com
手机号
全部号码 所有手机(电信、移动、联通)的可用号码段如下:
      130 131 132 133 134 135 136 137 138 139 ---- /^13\d{9}$/
      xxx xxx xxx xxx xxx 145 xxx 147 xxx xxx ---- /^14[57]\d{8}$/
      150 151 152 153 xxx 155 156 157 158 159 ---- /^15[012356789]\d{8}$/
      180 181 182 183 184 185 186 187 188 189 ---- /^18\d{9}$/

正则表达式:
/^1([38]\d|4[57]|5[012356789])\d{8}$/
移动号码 移动的可用手机号码段如下:
      1340-1348、135、136、137、138、139、
      147、
      150、151、152、157、158、159、
      182、183、184、187、188

正则表达式:
/^1(34[012345678]|3[56789]\d|47\d|5[012789]\d|8[23478]\d)\d{0,7}$/
电信号码 电信的可用手机号码段如下:
133、1349、153、180、181、189

正则表达式:
/^1(33\d|349|53\d|8[019]\d)\d{0,7}$/
联通号码 联通的可用手机号码段如下:
130、131、132、145、155、156、185、186

正则表达式:
/^1(3[012]|45|5[56]|8[56])\d{0,8}$/


正则表达式链接

脚本之家:http://www.jb51.net/article/19493.htm

显示框架
top