Match, highlight and pull out capture groups.
Runs against the browser’s own regex engine, so behaviour matches what your JavaScript will do — including the differences from PCRE.