in reply to Regular expression...
Here is one way to do it.
Updated: included '\n' before =end.$string =' some another lines =begin some lines some lines =end some another lines...'; while ($string =~ /(?:(?:^|\n)=begin)((?:(?!\n=end).)*)\n=end/gs){ print "$1\n"; } output: ======= some lines some lines
Prasad
In Section
Seekers of Perl Wisdom