in reply to Re: Pattern matching: Lazy vs. greedy
in thread Pattern matching: Lazy vs. greedy
before, which is without the (?= before the regex and the ) after it. This didn’t get me anywhere. I thought I was familiar with look-around assertions, but to be honest, I don’t get what the (?=) is doing here. I thought it is only used as a modification to something preceding it. I consulted http://perldoc.perl.org/perlre.html#Extended-Patterns but could not find why the two variants give different results. Could you explain that to me?my @matches = $string =~ /(the .*? dog)/gi;
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^3: Pattern matching: Lazy vs. greedy
by choroba (Cardinal) on Mar 30, 2015 at 12:51 UTC | |
by false_friend (Novice) on Mar 30, 2015 at 17:47 UTC |