Javascript – Regex to find if string contains numbers and (commas, dots or -)
I'm attempting to create a valid regular expression to detect if a string is only numbers and digits or if it contains letters. The expression I'm using is: /^d+.?d+$|^d+$/.test(masked) TypeScript demo However whenever I type the next (.) index, the…