Perl Regex: lookahead & lookforeword matching

来源:互联网 发布:msn软件下载 编辑:程序博客网 时间:2024/06/05 03:18
#lookahead & lookforeword matching
___FCKpd___0
= "tom cat";if ( /tom(?=cat)/ ) { print "find tom, follow by cat/n";}if ( /(?!tom)cat/ ) { print "find cat, and tom is in front of 'cat'/n";}