[TxMt] Problems with regex

Jaime Vargas jev at mac.com
Tue Oct 26 13:27:03 UTC 2004


I am  making a syntax module for the Rebol language and I am having 
trouble getting some keywords to match properly. This expression works:

match = "(action!|any-block!|any-function!|)"

but it is not ideal for I needed it to work with word boundaries. When 
I include word boundaries in the regex, the rule is never matched.

match = "\\<(action!|any-block!|any-function!|)\\>"

I think this is a problem with the exclamation point "!". I have tried 
using it with these escape sequences: \!, \\!, \041 \\041; with no luck 
so far.

I had the same problem with keywords having the question mark "?" in 
them, ie:

match = "\\<(about|abs|absolute|action?|add|alert|type?)\\>"

Ideas would be most welcome. Is there a limitation in the regex engine?

Thanks, Jaime




More information about the textmate mailing list