Regular Expression Google Forms

2019-08-12 00:52发布

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条回答
我命由我不由天
2楼-- · 2019-08-12 01:34

For a text field, do the following:

  1. Go to Advanced Settings -> Data validation -> Regular Expression
  2. Set to the condition to matches
  3. Add [0-9]+ regex to the text field on the right.

enter image description here

查看更多
登录 后发表回答