首页 > 开发 > 综合 > 正文

Regular Expression Library(1)

2024-07-21 02:20:18
字体:
来源:转载
供稿:网友
国内最大的酷站演示中心!
expression:  ^([a-za-z0-9_/-/.]+)@((/[[0-9]{1,3}/.[0-9]{1,3}/.[0-9]{1,3})|([a-za-z0-9/-/.]+))/.([a-za-z]{2,3}|[0-9]{1,3})(/]?)$  rating: 10 [ rate]  
description:   email validator that adheres directly to the specification for email address naming. it allows for ...  
matches:  [[email protected]], [[email protected]], [[email protected]]  [ more details]  
non-matches:  [joe], [@foo.com], [[email protected]]  [ test expression]  
submitted by:  andy smith ([email protected])  

expression:  ^/d{1,2}///d{1,2}///d{4}$  rating: 4 [ rate]  
description:   this regular expressions matches dates of the form xx/xx/yyyy where xx can be 1 or 2 digits long an...  
matches:  [4/1/2001], [12/12/2001], [55/5/3434]  [ more details]  
non-matches:  [1/1/01], [12 jan 01], [1-1-2001]  [ test expression]  
submitted by:  steven smith ([email protected])  

expression:  ^[a-za-z]{1,2}[1-9][0-9]{0,1} {0,1}[1-9][a-za-z]{2}$  rating: 4 [ rate]  
description:   matches uk postcodes  
matches:  [g1 1aa], [eh10 2qq], [sw1 1zz]  [ more details]  
non-matches:  [g111 1aa], [x10 ww], [ddd 5ww]  [ test expression]  
submitted by:  dave sparks ([email protected])  

expression:  //*[/d/d]*?/*/  rating: 2 [ rate]  
description:   if you need to extract or remove any /* */ sytle comments from any java, javascript, c, c++, css, e...  
matches:  [/* my comment */], [/* my multiline comment */], [/* my nested comment */]  [ more details]  
non-matches:  [*/ anything here /*], [anything between 2 seperate comments], [/* */]  [ test expression]  
submitted by:  chris craft ([email protected])  

expression:  ^/d{5}-/d{4}|/d{5}|[a-z]/d[a-z] /d[a-z]/d$  rating: 2 [ rate]  
description:   this expression matches three different formats of postal codes: 5 digit us zip code, 5 digit us zi...  
matches:  [44240], [44240-5555], [g3h 6a3]  [ more details]  
non-matches:  [ohio], [abc], [g3h6a3]  [ test expression]  
submitted by:  steven smith ([email protected])  

expression:  ^(25[0-5]|2[0-4][0-9]|[0-1]{1}[0-9]{2}|[1-9]{1}[0-9]{1}|[1-9])/.(25[0-5]|2[0-4][0-9]|[0-1]{1}[0-9]{2}|[1-9]{1}[0-9]{1}|[1-9]|0)/.(25[0-5]|2[0-4][0-9]|[0-1]{1}[0-9]{2}|[1-9]{1}[0-9]{1}|[1-9]|0)/.(25[0-5]|2[0-4][0-9]|[0-1]{1}[0-9]{2}|[1-9]{1}[0-9]{1}|[0-9])$  rating: 2 [ rate]  
description:   regexp for validating the format of ip addresses. this works great with the asp.net regularexpressi...  
matches:  [127.0.0.1], [255.255.255.0], [192.168.0.1]  [ more details]  
non-matches:  [1200.5.4.3], [abc.def.ghi.jkl], [255.foo.bar.1]  [ test expression]  
submitted by:  g. andrew duthie ([email protected])  

expression:  ^/w+[/w-/.]*/@/w+((-/w+)|(/w*))/.[a-z]{2,3}$  rating: 2 [ rate]  
description:   email validation. with this short expression you can validate for proper email format. it's short...  
matches:  [[email protected]], [[email protected]], [[email protected]]  [ more details]  
non-matches:  [[email protected]], [[email protected]], [[email protected]_com]  [ test expression]  
submitted by:  eric lebetsamer ([email protected])  

expression:  ^#?([a-f]|[a-f]|[0-9]){3}(([a-f]|[a-f]|[0-9]){3})?$  rating: 2 [ rate]  
description:   tests for valid html hexadecimal color codes. the # symbol is optional. and it will except either t...  
matches:  [#00ccff], [#039], [ffffcc]  [ more details]  
non-matches:  [blue], [0x000000], [#ff000]  [ test expression]  
submitted by:  chris craft ([email protected])  

expression:  (/w+)/s+/1  rating: 1 [ rate]  
description:   this expression uses a backreference to find occurrences of the same word twice in a row (separated...  
matches:  [hubba hubba], [go go], [12 12]  [ more details]  
non-matches:  [may day], [gogo], [1212]  [ test expression]  
submitted by:  steven smith ([email protected])  

expression:  ^/d$  rating: 1 [ rate]  
description:   matches exactly 1 numeric digit (0-9).  
matches:  [1], [2], [3]  [ more details]  
non-matches:  [a], [324], [num]  [ test expression]  
submitted by:  steven smith ([email protected])  

发表评论 共有条评论
用户名: 密码:
验证码: 匿名发表