Reputation: 9863
Regular expression [13579]?[13579]?
returns infinite
(as http://regexr.com/ says).
Why? I just want to find two jointed odd numbers (two, not more) 😒.
Upvotes: 1
Views: 51
Reputation: 91598
The ?
character in RegEx means zero or one of the preceding set. So, your regular expression would match literally everything, as well as two odd numbers in a row.
You'll probably want something like:
[13579]{2}
Which means two and only two of the preceding set.
Upvotes: 1