I\'m stuck on a RegEx problem that\'s seemingly very simple and yet I can\'t get it working.
Suppose I have input like this:
Some text %interestingbi
Why do you have the extra set of parentheses?
Try this:
%interestingbit%.+?(?OPTIONAL_THING)?.+?%anotherinterestingbit%
Or maybe this will work:
%interestingbit%.+?(?OPTIONAL_THING|).+?%anotherinterestingbit%
In this example, the group captures OPTIONAL_THING, or nothing.