2010-03-11 45 views

回答

3

(?=…) and (?!…)(lookaheads)断言它后面的字符串匹配/不匹配子正则表达式,而没有实际使用它们。它们可以出现在任例如

^(\d)(?!\1)\d+$ 

比赛

12345 
67890 

但不

11234 
55678 

http://www.regular-expressions.info/lookaround.html查看详细。

相关问题