I am sorry,this question will be marked previously asked.But I went through many threads.There are many answers to the given problem.But some how i am unable to figure out what i am doing wrong.
My requirement is to not match more than 1 numeric after decimal
and Also non decimal numbers should be discarded.
What i wrote
When i try to match 11.123 or 123 i get a match. What am i doing wrong?
This regex works for your use case:
^\d+ match from starting of the string all digits (that must be one or more since there is
+), then escape
\. and finally
\d$ match only if there is one char before the end of the string