Posted 18 years ago
by Benjamin Lewis
![Avatar](https://secure.gravatar.com/avatar/c913a3ccd32ff3b07667ed7c03215271.jpg?s=64&d=identicon&r=g)
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]