Comment
Comment by burntsushi
ripgrep can do it! :)
or more succinctly:
Example:
Named groups work too:
You can also replace the whole match by combining --replace with --only-matching:
Of course, I understand capturing groups are useful to have in awk when you're using awk. ripgrep can only handle very simplistic cases. But they tend to be quite common.