in reply to Greedy modifier found to be working non-greedy in a named group
To conclude, the explanation of leftmost first and then longest will be valid even if I didn't use named groups.
So, for example,
and$_ = "This is a teeeext for testting"; /(e*)/ and print "'$1' is matched pattern\n"; # gives '' is matched pattern
$_ = "This is a teeeext for testting"; /(e+)/ and print "'$1' is matched pattern\n"; # gives 'eeee' is matched pattern
So, this behavior is generic.
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^2: Greedy modifier found to be working non-greedy in a named group
by haukex (Archbishop) on Nov 29, 2019 at 21:08 UTC |