If you think about it, there are only two reasonable choices for this: minimalist and maximalist (aka greedy) matching. In Perl (and every other regex syntax I know of) the default is to make the matching greedy; furthermore, Perl gives you the option to make the matching minimalist if that's what you want. As far as I can tell, this choice is arbitrary; it could have gone the other way.
But I'm just guessing here, and I could easily be wrong (i.e. there may be some fundamental reason for which maximalist matching is a more reasonable default than minimalist matching); if so, I look forward to being corrected.
the lowliest monk
In reply to Re: greedy search
by tlm
in thread greedy search
by palette
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |