[TxMt] Syntax match pattern

Allan Odgaard allan at macromates.com
Tue Nov 2 21:36:03 UTC 2004


On 2. Nov 2004, at 21:11, Dave Carlton wrote:

> Where I am trying to say find a space followed by one of the following 
> words followed by white space.
>
> But in my test file only some of the words are highlighted when all of 
> them should be as in the following example. What am I doing wrong?

Your pattern “eats” the space before and after the keyword. So there 
will be no space left for the next keyword (which needs to be prefixed 
by one).

You can change the last “\\s” to “(?=\\s)”, which just ensures there's 
a space after the keyword, but doesn't eat it.  Though it will still 
eat the first space (but if you follow this convention, eating the 
first, leaving the last, it should work).


Kind regards Allan




More information about the textmate mailing list