Posted 20 years ago
by (Anonymous)

I'd like to distinguish between functions and identifiers. I'm using the following regular expressions in my language definition file:
The above definitions don't work when the last OR only text in the editor is a word. For example, if all that is in the editor is "customerID" (w/out the quotes), the token is FunctionToken. I was expecting it to be the IdentifierToken.
Why does the LookAhead for the FunctionToken match in this case?
<!-- Function -->
<RegexPatternGroup Token="FunctionToken" PatternValue="(_ | {AlphaMacro})({WordMacro})*" LookAhead="{WhitespaceMacro}*[(]"/>
<!-- Identifier -->
<RegexPatternGroup Token="IdentifierToken" PatternValue="(_ | {AlphaMacro})({WordMacro})*"/>
Why does the LookAhead for the FunctionToken match in this case?