February 1, 2007
以前只知道用Lookahead,今天第一次遇到Lookbehind的实例。
下面这段摘自 regular-expressions.info (很好的一个正则站点):
Lookbehind has the same effect, but works backwards. It tells the regex engine to temporarily step backwards in the string, to check if the text inside the lookbehind can be matched there. (? matches a “b” that is not preceded by an “a”, using negative lookbehind. It will not match cab, but will match the b (and only the b) in bed or debt. (?<=a)b (positive lookbehind) matches the b (and only the b) in cab, but does not match bed or debt.

