What would be the regex to allow digits and a dot? Regarding this \\D only allows digits, but it doesn\'t allow a dot, I need it to allow digits and
\\D
\d*\.\d*
Explanation:
\d* - any number of digits
\. - a dot
\d* - more digits.
This will match 123.456, .123, 123., but not 123
123.456
.123
123.
123
If you want the dot to be optional, in most languages (don't know about jquery) you can use
\d*\.?\d*