... Also related, a
SED/AWK/YAML asking of the same idea. But its answers are not at all for arbitrary regex syntax (a very broad question), only simple kludges for the very simple example given: non-nested parentheses (create|delete)? Want to see [...] or ['^...] groups, +*? repletion operators, nested parentheses, ideally multiple capture groups, backreferences, maybe lookahead assertions, ...