my $re = qr/(?:(simple).*?)+/; my $string = "This is a simple thing just a simple simple thing."; $string =~ /$re$re$re/g; say $1 if $1; # says simple say $2 if $2; # says simple say $3 if $3; # says simple
In reply to Re: Matching a regular expression group multiple times
by Anonymous Monk
in thread Matching a regular expression group multiple times
by Anonymous Monk
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |