[TxMt] two minor find quibbles

Jay Soffian jay-txmt at soffian.org
Tue Jun 12 04:57:02 UTC 2007


On Jun 12, 2007, at 12:41 AM, Michael Sheets wrote:

> I'd find it pretty worthless if it didn't… ;) Generally speaking  
> though I'm not sure what your meaning, you have to specifically  
> match the newline character somehow, so if you don't want to match  
> multi-line simply don't match a newline no? It uses the Oniguruma  
> syntax so yo can also change the method the . character type  
> matches, newlines or no newlines.

I was using a match like:

functionName\s*\(([^\)]*)\)

When the negated character class (not to mention the \s*) matched  
across lines, it was not what I wanted. Sure, the fix is simple  
(though it makes an ugly regex even uglier):

functionName[\t ]*\(([^\)\n]*)\)

Nonetheless, it caught me by surprise since I otherwise think of  
TextMate as being line-oriented.

(Yes, I probably could've used .*? in lieu of the negated character  
class.)

j.


More information about the textmate mailing list