speaking as an old regexp wizard from before perl5, this is indeed a great trick, have an upvote.
sadly, this trick still requires a code comment to explain. Python example:
# match tarzan but not "tarzan"
# see https://news.ycombinator.com/item?id=27774584
if "tarzan" == re.search(r'"tarzan"|(tarzan)', myvar)[1]:
...
which in practice means it probably deserves a function: if re_search_but_exclude(r'tarzan', myvar, '"tarzan"'):
...
I don't recommend monkeypatching re, i.e. re.search_but_exclude = ...