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 one dot this is refer as a float value I need to be valid when doing a keyup
function in jQuery, but all I need is the regex that only allows what I need it to allow.
This will be in the native of JavaScript replace
function to remove non-digits and other symbols (except a dot).
Cheers.
Regex.Replace("xyzzy", @"\d*(\.\d+)?", "!");
will be!x!y!z!z!y!
. I'm pretty sure the results in JavaScript will be the same. Since everything's optional, the regex will match at every position. – Trinhtrini