use re 'eval'; my $string = "hello world ballloon"; my $regex = qr/ll/; my @matches; () = $string =~ /(?=$regex)(?{push @matches, pos})./g; print join "\n", @matches; __END__ 2 14 15
--
flounder
In reply to Re: •Re: positions of all regexp matches
by flounder99
in thread positions of all regexp matches
by glwtta
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |