Which regex engine is this?
The browser’s own JavaScript engine, so what matches here matches in Node and in every current browser. Python’s re and PCRE differ in lookbehind, possessive quantifiers and Unicode classes.
What is the v flag?
Unicode sets, added in ES2024: set operations and string properties inside [...], with stricter syntax than u.
Why did my pattern stop?
It ran for more than 1.5 seconds, which is catastrophic backtracking: nested quantifiers such as (a+)+ over text that nearly matches. Explain shows the nesting; rewriting it so each character can match only one way fixes it.
How do I refer to a named group in Replace?
With $<name>. Numbered groups are $1, $2 and so on, and $& is the whole match.