Given a regex like
(a|b){2}\1
What will it refer to \1? First capture, last capture or what?
Regex.IsMatch("aba", @"^(?:(a|b){2}\1)$") == False
Regex.IsMatch("abb", @"^(?:(a|b){2}\1)$") == True
Lets me suspect that it matches the last capture. Am I right in this assumption?
source
share