How to match a regex with backreference in Go?
问题 I need to match a regex that uses backreferences (e.g. \1) in my Go code. That's not so easy because in Go, the official regexp package uses the RE2 engine, one that have chosen to not support backreferences (and some other lesser-known features) so that there can be a guarantee of linear-time execution, therefore avoiding regex denial-of-service attacks. Enabling backreferences support is not an option with RE2. In my code, there is no risk of malicious exploitation by attackers, and I need