- (?=pattern) 零宽正向先行断言(zero-width positive lookahead assertion)
- (?!pattern) 零宽负向先行断言(zero-width negative lookahead assertion)
- (?<=pattern) 零宽正向后行断言(zero-width positive lookbehind assertion)
- (?<!pattern) 零宽负向后行断言(zero-width negative lookbehind assertion)
re(?=gular) # 限定匹配的re后面必须跟着gular,但不消耗 “gular”这些字符
re(?!pa) # 限定匹配的re后面不能跟着pa,不消耗"pa"
(?<=\w)re # 限定,在re前面必须具有字符(一扫描过的),相对扫描方向相反,因此叫后行
(?<!\w)re # 限定,在re前面不能有字符