问题
I have a scripp in a google spreadsheets which submits new forms and makes some calculations. Some people fill the number fields with things like ".00" instead of ",00". I have field validation in the form to only take whole numbers, but doesn't prevent this from happening. So 120.00 its not interpreted as 120 by google spreadsheets, it even cant parse it as a number.
I tried many workarounds with spreadsheets formulas with no luck but reading a bit i found the best way is to use a regular expression in the form validation.
I need a regular expression to prevent user from using "." and "," as i only want whole numbers.
回答1:
For a text field, do the following:
- Go to Advanced Settings -> Data validation -> Regular Expression
- Set to the condition to matches
- Add
[0-9]+
regex to the text field on the right.
来源:https://stackoverflow.com/questions/32121994/regular-expression-google-forms