摘要:
匹配FRED 时,也能匹配上fred, Fred,可以使用修饰符/i。点(.)不匹配换行符,这对于“单行中查找”的问题能很好解决。如果你的字符串中有换行符,那可以使用/s 这个修饰符。$_="I saw Barney\ndown at the bowling alley\nwith Fred\nlast night.\n";if(/Barney.*Fred/s){print "That string mentions Fred after Barney!\n";}else{print "No matched!"}/x 修饰符,允许你在 阅读全文