I am trying to create a Regex for matching version number which can be in format as 1.2.3.4 It can also contain only one number like 12 or it can also contain *(asterisk) instead of numbers.
I tried creating this as follows
[\d*]*\.[\d*]*\.[\d*]*\.[\d*]*
This works to some extent, but it needs to have exactly in that format ie it needs to have all the decimal points whereas what am looking for is to allow any number and * in the version type.
Invalid scenarios can be
1.2.4.5.6.
.
3.4.
Valid scenarios are
12
*
*.*
12.34.5.*
1.4.5.6
3.*.*
Any help in this ?
Thanks