Reputation: 101
I have the string [TITLE|suffix=my value|prefix=another value]
and I would like to get the match of my value
.
This is what I have tried:
(?<=TITLE\|suffix=).+[^|\]]
But then the match will be my value|prefix=another value]
.
Why is it ignoring the character |
after my value
?
See here: https://regexr.com/5h0h2
Upvotes: 0
Views: 45
Reputation: 163217
You should exclude the |
and ]
from being part of the match using a negated character class and repeat the character class.
(?<=TITLE\|suffix=)[^|\]]+
Upvotes: 3