Working with Notepad++ v7.9 here.
Suppose R
is a complex regexp pattern. I now want to match _R
, R_
, or_R_
but not R
alone. How to do this without writing explicitly (_R|R_|_R_)
? This requires R being written out three times and looks ugly.
The closest I can think of is _?R_?
but this also matches R
alone (and is in fact equivalent to it), which is a false positive to me.
In between is (_?R_|_R_?)
but R
is repeated again here, though one less time.
(?!^R$)_?R_?
_?(R)_?\1?_
interesting. regex101.com/r/KKNrJa/1