If i understood your question correctly, this will work.
'.' matches newline character when you use the 's' option modifier in your regex. Also take a look at perlre.
#! /usr/bin/perl $str = "aaaaa\nbbbbb\nccccc\naaaaa\nddddd\neeeee\n" ; @a = $str =~ /aaaaa(?:(?!aaaaa).)*/gs ; print "$a[0]\n$a[1]" ;
updated: removed extra grouping.
Thanks in advance
Prasad
In reply to Re: multi-line regexp
by prasadbabu
in thread multi-line regexp
by jeanluca
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |