I want to get such matches:
3.1.0
10.5.1
0.5
which may represent builds version numbering system.
Non-matches:
3.1.
I tried this regex:
[0-9]+\.[0-9]+
This gets only 0.5
but not 10.5.1
.
What about this:
\d+(?:\.\d+)+
How about this?
^\d{1,3}\.\d{1,3}(?:\.\d{1,6})?$
This will match Major.Minor and optional revision. Major and Minor can be 1-3 digits (0-999) and Revision can be 6 digits.
Valid: 1.1 1.2.3 1.2.123456
Not valid: 1 1.2. 1.2.1234567 1.2.* Anything with a alpha character
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With