You may filter all the matching strings one by one as follows:
my $string = ' hi hello @begin i want this to extract yes i want @end asas x x x x x zxzxax hi hello hi hellooo @begin i want this to extract yes i want @end ...'; while ($string =~ m/\@begin([\w\W]*?)\@end/g) { print "match: $1\n"; }
In reply to Re: help regarding a regular expression in perl
by pme
in thread help regarding a regular expression in perl
by praveenchappa
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |