I am experimenting with regex backreferences and I am stuck at some very simple case.
Regexp which does not match the whole input:
([\D\s]+)(\d+)\1
Input:
Foo 12 bar
Link: https://regex101.com/r/yfFLmc/1/
On the other hand, the same regex without backreference(but with repetition of first capturing group) matches the whole input correctly: ([\D\s]+)(\d+)([\D\s]+)
Why the regex with backreference doesn't match the whole input?