is not the regular expression originally quoted non-greedy?
It is. But what do you expect non-greedy to be? Some people think that non-greedy means "match an as short string as possible", without anything else. But there is just one such a string, and that's the empty string.
Non-greedy does not mean, "don't match where you would match otherwise". If a pattern matches with greedy (sub) matches, it will match with non-greedy sub matches. And if a pattern doesn't match with non-greedy sub matches, it will not match with greedy sub matches.
All greedy/non-greedy will do is change $&, it will not change whether or not a pattern matches.
| [reply] |