#!perl while(<>){ chomp; if(/REGULAR_EXPRESSION/){ print "Match: |$`<$&>$'|"; }else{ print "No match: $_"; } } $&是匹配到的内容。