I'm using AvalonEdit in an app that runs my own custom-built language. I have defined a highlighting.xml file that works just fine.
Now I am trying to extend it according to:
the next word appearing after "method" is colored blue.
I came up with this regex to do so:
(?s)(?<=method )(.+?)(?= )
And tested it with this input:
via method AMethod on interface
Which works fine with http://regexstorm.net/tester.
Then I tried the following rules, but none worked. With them nothing gets highlighted anymore.
<Rule foreground="DarkBlue">
\(?s)(?<=method )(.+?)(?= )
</Rule>
<Rule foreground="DarkBlue">
\(?s)(?<=method )(.+?)(?= )
</Rule>
<Rule foreground="DarkBlue">
(?s)(?<=method )(.+?)(?= )
</Rule>
This one did not break the highlighting, but did not work either:
<Rule foreground="DarkBlue">
(?s)(?<=method )(.+?)(?= )
</Rule>
Is what I am trying to do possible? Is the regex correct? I am a complete ignorant on regex.
Thanks in advance.
Update for Divisadero's answer
This ones break the Highlighting.
<Rule foreground="DarkBlue">
\(?s)(?<=method )([^' ']+)
</Rule>
<Rule foreground="DarkBlue">
\(?s)(?<=method )([^' ']+)
</Rule>
<Rule foreground="DarkBlue">
(?s)(?<=method )([^' ']+)
</Rule>
This ones don't break the Highlighting but don't work:"
<Rule foreground="DarkBlue">
(?s)(?<=method )([^' ']+)
</Rule>