Considering
NN = number/digit
x = any single letter
I want to match these patterns:
1. NN
2. NNx
3. NN.NN
4. NN.NNx
5. NN.NN.NN
6. NN.NN.NNx
Example that needs to be match:
1. 20
2. 20a
3. 20.20
4. 20.20a
5. 20.20.20
6. 20.20.20a
Right now I am trying to use this regex:
\b\d+\.?\d+\.?\d+?[a-z]?\b
But if fails.
Any help would be greatly appreciate, thanks! XD
EDIT:
I am matching this:
<fn:footnote fr="10.23.20a"> (Just a sample)
Now I have a regex that will extract the '10.23.20a'
Now I will check if this value will be valid, the 6 examples above will be the only string that will be accepted.
This examples are invalid:
1. 20.a
2. 20a.20.20
3. etc.
Many thanks for your help men! :D