Closed liran closed 2 years ago
Your regex has catastrophic backtracking in it due to the nested repetition that allows any character (.
). This type of backtracking isn't possible in RE2 and prevents these kinds of issues, but it also limits the features that RE2 can have.
To prevent the catastrophic backtracking you'll want to use \.
in your pattern to match the literal dot instead of any character: dhgate(?:\.[a-z]+)+\/product\/
Run the following example (https://go.dev/play/p/BDU6yN5NvEZ):
output:
regexp2 version is v1.4.0 Hope it helps to improve performance.