Regex string help

Regex string help
0

#1

I am trying to work out the regex string to use in a for that will only allow the user to type into an amount field the following:
A whole number that contains no decimal point but is a number greater than 1000, but the user is not allowed to enter a dollar sign, nor comma, nor spaces. Everything I have tried does not cover each of these together but gives me an error. How do you combine all of these together in one string? Thank you for your help.


#2

<input type="number" min="1000">. User can only enter numbers, step defaults to integers so decimals not allowed in this case, starts at 1000.

Regex is for strings, not numeric amounts. If you don’t want to use a number input, and want a text input with regex validation, then regex for the non-numeric elements, then if that passes, parse the input to a number and validate that using maths.


#3

Thanks Dan and that makes sense. The problem is, I’m needing to put this into a Google Form and if only allows Regex string.
If I select their inbuilt validation to be just a whole number, it still allows a decimal point and commas, but the only other option in the forms is to enter a regular expression.


#4

/^[123456789]\d{3}\d*$/


#5

Thank you Dan. That’s perfect. Appreciated