in reply to Re^3: multi-line regexp
in thread multi-line regexp

hi, do we need 'g' modifier here ?, i tried your pattern matching with this code :

$str = "aaaaa\nbbbbb\nccccc\nddddd\naaaaa\nddddd\neeeee\n"; @a = $str =~ /(aaaaa(?:(?:(?!aaaaa).)*))/s; print "1 : $a[0]\n 2 : $a[1]\n";

and this code only match "aaaaa bbbbb ccccc ddddd" ($a[0])

and if we put g in pattern matching, i mean like this :

$str = "aaaaa\nbbbbb\nccccc\nddddd\naaaaa\nddddd\neeeee\n"; @a = $str =~ /(aaaaa(?:(?:(?!aaaaa).)*))/gs; print "1 : $a[0]\n 2 : $a[1]\n";

this will print out : "aaaaa bbbbb ccccc ddddd" and "aaaaa ddddd eeeee".

thanks, zak