Posted 20 years ago
by rconde01
Hi,
I have two problems related to regex parsing in the syntax editor.
1) I use the following regex:
<RegexPatternGroup Token="ObjectTypeWordToken" PatternValue="While\s*\(.*\)" Style="ObjectTypeKeyWord" IsWhitespace="True" CaseSensitivity="Sensitive" />
Which should match "While (sdsdf)" - minus the quotes. I've confirmed this using a dotnet regex tester. But the syntax editor doesn't seem to like a variable string between parentheses.
2) If I change the PatternValue to "While\s*\(.*?\)" it fails on LoadLanguageFromXml even though it's a valid regex. I thought maybe I had to escape the ? - but xml spy doesn't seem bothered by it.
Can you explain this behavior to me?
Thanks,
Robert Conde
I have two problems related to regex parsing in the syntax editor.
1) I use the following regex:
<RegexPatternGroup Token="ObjectTypeWordToken" PatternValue="While\s*\(.*\)" Style="ObjectTypeKeyWord" IsWhitespace="True" CaseSensitivity="Sensitive" />
Which should match "While (sdsdf)" - minus the quotes. I've confirmed this using a dotnet regex tester. But the syntax editor doesn't seem to like a variable string between parentheses.
2) If I change the PatternValue to "While\s*\(.*?\)" it fails on LoadLanguageFromXml even though it's a valid regex. I thought maybe I had to escape the ? - but xml spy doesn't seem bothered by it.
Can you explain this behavior to me?
Thanks,
Robert Conde