Reputation: 2673
/ab(?=.{1})$/g
doesn't match "abdabd" or anything else
It's the anchor $ that is troubling me. What can this regex match ?
Upvotes: 0
Views: 434
Reputation: 786081
What can this regex match ?
This regex won't match anything and is guaranteed to fail because:
ab - will literally match ab
(?=.{1}) - will use lookup to make sure there is at least 1 character after ab
$ - will assert end of input after ab
both conditions can never be met hence your regex will always fail.
Upvotes: 5