Reputation: 13
I want to get the 2 digit number and no number from more digit numbers. For example in string or word Hi3020want07see I just want the number 07, no digits from the 4 digit number (3020). Is there a pantern for this?
Upvotes: 1
Views: 195
Reputation: 91415
Use:
(?<!\d)\d\d(?!\d)
This is matching 2 digits not preceded or followed by other digits.
Upvotes: 1