I have an input field that I will only accept numbers, commas and periods. How can I test if the string is valid according to these rules?
I have tried the following:
var isValid = /([0-9][,][.])$/.test(str);
but it's not working. isValid variable is always false.