The following reg expression does exactly what I need it to do:
^(LASTRUN)*$
It matches the literal "LASTRUN" exactly and doesn't allow whitespace or any other characters anywhere(beginning, middle, or end of word).
Here is the error I get when implementing -
The regular expression value is invalid: ^ - Start of line matching is not supported $ - End of line matching is not supported
Is there a way to get around this or is there alternative regex to make this work?
Thanks,
Andy
Hello Andy,
Thank you for contacting Infragistics. Are you loading in a custom EBNF file alongside using the Syntax Parsing Engine in addition to using the XamSyntaxEditor? Please isolate the behavior in the sample attached below and I will investigate this further for you.
Let me know if you have any questions.
xamSyntaxEditor_regularexpressions.zip
Hi Michael,
Thanks for the response. I've put together a sample project which will hopefully show you what exactly I'm trying to accomplish.
I'm trying to show invalid match when "LASTRUN" (has to be inside % signs) does not exactly match the word LASTRUN(whitespace before or after % signs should be invalid - see Doesn't work! in picture below). The regular expression I'm testing that works -> ^(LASTRUN)$ cannot be used in the code snippet out of my sample project below:
var daVarContent = lexerState.Symbols.Add("DaVarContent", @"(LASTRUN)", TerminalSymbolComparison.RegularExpression); daVarContent.LanguageElementName = languageElementName; //daVarContent.LookaheadPattern = @"[^\S]"; //daVarContent.IsLookaheadNegative = true;
So, the main portion of the sample I'd like for you to take a look at is inside this method -
public void DAVariableLanguage2(Grammar grammar). Maybe there is a way to accomplish what I am trying to do by using a LookaheadPattern. I've done a lot of experimentation but haven't been able to make this work.
XamSyntaxEditorInvalidVars.zip
Please let me know if you need clarification or have any questions.