I have the following regex expression:
[0-7]{2}
For the following string 234212
, I get three matches:
23
42
12
I don't understand why I don't get also 34
, 12
?
You can try this:
(?=([0-7]{2}))
The above regex captures every valid pair in group 1 , I have used the positive look-ahead to achieve this as this helps to match without moving the cursor forward.