I am trying to write a regex for AvalonEdit.TextEditor to mark everything after the second | a certain color.
Example(value should be a color):
action|key|value
I am trying something like this but it doesn't work because I can't specify the group I wanna color.
^[^\|]*\|[^\|]*\|(?P<value>[^\|]*)
Any ideas?
Try this: (?<=[^\|]+\|[^\|]+\|)(?<value>[^\|]+)
The positive look-behind (?<=) will make sure action and key are not part of the match.
Normally you shouldn't use non-fixed length look-behinds but maybe this works for you.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With