JavaScript's regex engine isn't the only one to have these problems. There certainly are other implementations, like Re2 and Rust's implementation, that don't have this issue. But they also lack some of the features of the JS implementation too.
Ah, I didn’t realise there was a regex channel here. Thanks!
That’s brilliant!