How can I modify this regular expression to allow numbers with just one point?
Your regex doesn't matches what you say it matches. You have used negation in character class, and that too without any quantifier. Currently it would match any non-digit character other than
For your requirement, you can use this regex: