Пока читал про backreferences набрёл на забавное
>> The documentation shows many types of backreferences, but they're all marked as "NOT SUPPORTED". I've only tried a couple of those, to see whether the documentation was accurate, and they didn't work.
Backreferences are an important part of regular expression use. Please add support for them. At the least, support the numbered backreference syntax, \1.
> Sorry, RE2 cannot support backreferences without compromising its principles.
https://github.com/google/re2/issues/101