in reply to Iterating over code embeded in regex
I think you shouldn't use the (?{...}) construct without a very good reason. To run some code on all matches of a regexp in a string, you can do this for example (untested):
Or, if you want overlapping matches too, thenwhile ($string =~ /(pattern)/g) { do_something_with($1); }
while ($string =~ /(?=(patter))/g) { do_something_with($1); }
|
|---|