[TxMt] Better JavaScript functions

Michael Sheets mummer at whitefalls.org
Sun Sep 18 19:02:58 UTC 2005

> On a side note, again ... when do you use non-greedy matches and  
> what are they good for?

Regex will look for the biggest match possible, so:

(this) is a (test)

With "\\(.*\\)" would match the whole string at once. Making it non- 
greedy *? does the reverse, ends the match as soon as possible.  
Making the match "(this)", what was intended.

More information about the textmate mailing list