... and you don't even need capturing parentheses:
>perl -wMstrict -le "my $string_to_search = 'This part of all of this paart of the string. Paaaaart!'; ;; my $pattern = qr{ (?i) pa+rt }xms; my @results = $string_to_search =~ /$pattern/g; printf qq{'$_' } for @results; " 'part' 'paart' 'Paaaaart'
In reply to Re: Capturing string matched by regex
by AnomalousMonk
in thread Capturing string matched by regex
by tunafish
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |