Posted 19 years ago
by Benjamin Lewis
The following pattern group is incorrectly matching the first word in my document:
<RegexPatternGroup TokenKey="AliasToken" Style="AliasStyle" PatternValue="{AlphaMacro} {WordMacro}*" LookBehind="as {WhitespaceMacro}+" />
If I have a document that begins with, say, the line "var foo : int;", the word "var" is being highlighted in AliasStyle, as if the LookBehind had instead been written LookBehind="^ | as {WhitespaceMacro}*". If I prepend a single space, highlighting works properly.
[update]: I meant, of course, that the LookBehind is behaving like
LookBehind="\A | as {WhitespaceMacro}*" (beginning of document, rather than beginning of line).
Thanks,
--
Benjamin Lewis
[Modified at 06/27/2006 02:47 PM]
<RegexPatternGroup TokenKey="AliasToken" Style="AliasStyle" PatternValue="{AlphaMacro} {WordMacro}*" LookBehind="as {WhitespaceMacro}+" />
If I have a document that begins with, say, the line "var foo : int;", the word "var" is being highlighted in AliasStyle, as if the LookBehind had instead been written LookBehind="^ | as {WhitespaceMacro}*". If I prepend a single space, highlighting works properly.
[update]: I meant, of course, that the LookBehind is behaving like
LookBehind="\A | as {WhitespaceMacro}*" (beginning of document, rather than beginning of line).
Thanks,
--
Benjamin Lewis
[Modified at 06/27/2006 02:47 PM]