in reply to non-greedy incremental regular expression?
Use .*? for immediate match
See the changes below of your code:
my $s = '<blah>red</blah><blah>white</blah><blah>blue</blah>'; while ($s=~/<blah>(.*?)<\/blah>/) { # this RE isn't right... print "\n$1";sleep 1; }
Update:: Remove /g
|
|---|