Seems neat but doesn't seem to work in the latest Firefox (though I do have a hardened user config, I don't think its relevant here). The error showing up in the console is "SyntaxError: invalid regexp group".
On FF this usually means that the regexp uses `lookbehind`: https://caniuse.com/#feat=js-regexp-lookbehind