in reply to Regex bug in 5.10 (was: Using Look-ahead and Look-behind)
in thread Using Look-ahead and Look-behind
I have read the documentation you have cited and it helped, so I played around some more and tried out the following, which only exchanges "+" for "*" in your original expression, really works as one would think and therefore would be my preferred solution, at least for Perl 5.10:
Output:$_ = "Hello"; print "$1\n" while /(?=(.+))/g;
Hello ello llo lo o
|
---|
Replies are listed 'Best First'. | |
---|---|
Re^2: Regex bug in 5.10 (was: Using Look-ahead and Look-behind)
by ikegami (Patriarch) on Nov 28, 2024 at 17:00 UTC |