([.|\n]+ 과 같이 쓰면 원하는 대로 동작 안함)
$text = "The quick brown\nfox jumps over the lazy dog. Hahaha.";
if($text =~ /^(.+)jumps/s){
print "MATCH\n" . $text;
}else{
print "NOT match\n" . $text;
}
키워드 : all characters including newlines레퍼런스 : Regex to match any character including new lines
No comments:
Post a Comment