正则表达式Google表单 [英] Regular Expression Google Forms

查看:328
本文介绍了正则表达式Google表单的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我在Google电子表格中有一个scripp,它提交新的表格并进行一些计算。有些人用.00而不是,00填充数字字段。
我在表单中进行了字段验证,只取整数,但并不妨碍这种情况的发生。
所以120.00它的谷歌电子表格不能解释为120,它甚至不能将其解析为数字。



我尝试了很多解决方法,但没有运气的电子表格公式阅读了一下,我发现最好的方法是在表单验证中使用正则表达式。

我需要一个正则表达式来防止用户使用。和,,因为我只想整数。

解决方案

对于文本字段,请执行以下操作:


  1. 转到高级设置 - > 数据验证 - > 正则表达式

  2. 添加 [0-9] +
  3. 设置为匹配条件 code> regex添加到右侧的文本字段中。


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.

解决方案

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.

这篇关于正则表达式Google表单的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆