I want to avoid characters like "^+%&/!'&(" in the textbox(decimal). What is the correct regular expression?
For instance:
Valid: 1,3 or 1,34 or 1
İnvalid: ^4,^' or %2,4 or !!
I want to avoid characters like "^+%&/!'&(" in the textbox(decimal). What is the correct regular expression?
For instance:
Valid: 1,3 or 1,34 or 1
İnvalid: ^4,^' or %2,4 or !!
You could try
(\d+[.,])?\d+
This means zero or more digits followed optionally by a decimal point, and then one or more digits.
Edit: Updated to include commas and at least one decimal before the decimal point if the decimal point is present