lucy24 - 7:05 pm on Jun 29, 2013 (gmt 0)
That's not a fact.
It is a fact. The words "greedy", "promiscuous" and "ambiguous" are all technical terms with precise meanings.
For arcane historical reasons, a great deal of Regular Expressions terminology has to do with food, so for example one speaks of "flavors" rather than dialects.
Regular Expressions are greedy by nature. (The opposite term is mercifully "stingy" rather than, say, "finicky" ;)) The notation
"capture as many characters as you possibly can, so long as there is an 'a' left over"
"capture some characters, stopping as soon as you hit the first 'a'".
You can look up "promiscuous" and "ambiguous" for yourself.
Lots of people get by with imperfect rules and slapdash patterns. It is much less common for someone to actively encourage and recommend doing things sloppily-- not simply because you're lazy and "it's good enough for me" but because you think it's better to do a half-### job.
When you're first composing a rule, it may take a little longer to devise the best possible format. (Remember, though, that a nanosecond for the server is in no way comparable to a nanosecond of human programming time.) This, however, pales by comparison with the absolutely colossal amount of time wasted in this forum in recent months, arguing over what ought to be ordinary ordinary common sense. Frankly I'm surprised I have not yet been asked to "justify" the recommendation to list conditions in order of likelihood-to-fail.
Oh yes and...
There is one extremely powerful argument that could be made in favor of the ".*a" formulation. The fact that this argument has not been made tends to speak for itself.