regex match only two group

enter image description here

I want to receive in example regex match only 17 and 20 (skip 3 match only two match)

>Solution :

Depending on what you want to do, this one can be a good solution

[0-9]{2}(?!$)

It matches the groups of 2 digits not at the end of a line !

You can also try : ([0-9]{2})\s[A-z]+\s([0-9]{2}) if you want only 2 groups

Leave a Reply