Google电子表格根据其他人的价值查找单元格(Google spreadsheet look up cell based on value of other)
我们试图使用这个电子表格 ,我将参考。
我试图让单元格X4显示列A中的数据,相对于单元格X3中显示的列B的最大值,即在写入时最大值列为27,这是通过“Purelycraft”完成的我希望它使用公式来自动显示名称“Purelycraft”,因为他杀死的最多。
The spreadsheet we are trying to use this on and I will be referencing.
I am trying to get cell X4 to display the data from column A relative to the max of column B as displayed in cell X3, ie at the time of writing this the maximum is listed as 27, which was done by "Purelycraft" and so I want it to use formulas to automatically display the name "Purelycraft" as he has the most kills.
原文:https://stackoverflow.com/questions/20959318
最满意答案
这是我在网上找到的一个很酷的正则表达式。 它以几乎任何美国格式验证一个数字并将其转换为(xxx)xxx-xxxx。 我认为这很好,因为那时人们可以使用他们习惯使用的任何格式输入任何10位数字的美国电话号码,并从中得到格式正确的号码。
以下是您可以放入MY_form_validation类的全部功能。 我希望我的表单允许空字段,所以如果你想强制一个值,你必须改变它。
function valid_phone_number_or_empty($value) { $value = trim($value); if ($value == '') { return TRUE; } else { if (preg_match('/^\(?[0-9]{3}\)?[-. ]?[0-9]{3}[-. ]?[0-9]{4}$/', $value)) { return preg_replace('/^\(?([0-9]{3})\)?[-. ]?([0-9]{3})[-. ]?([0-9]{4})$/', '($1) $2-$3', $value); } else { return FALSE; } } }
Here's a cool regex I found out on the web. It validates a number in almost any US format and converts it to (xxx) xxx-xxxx. I think it's great because then people can enter any 10 digit US phone number using whatever format they are used to using and you get a correctly formatted number out of it.
Here's the whole function you can drop into your MY_form_validation class. I wanted my form to allow empty fields so you'll have to alter it if you want to force a value.
function valid_phone_number_or_empty($value) { $value = trim($value); if ($value == '') { return TRUE; } else { if (preg_match('/^\(?[0-9]{3}\)?[-. ]?[0-9]{3}[-. ]?[0-9]{4}$/', $value)) { return preg_replace('/^\(?([0-9]{3})\)?[-. ]?([0-9]{3})[-. ]?([0-9]{4})$/', '($1) $2-$3', $value); } else { return FALSE; } } }
相关问答
更多-
这个怎么样? /(7|8|9)\d{9}/ 它从寻找7或8或9开始,然后是9个数字。 How about this? /(7|8|9)\d{9}/ It starts by either looking for 7 or 8 or 9, and then followed by 9 digits.
-
这是我在网上找到的一个很酷的正则表达式。 它以几乎任何美国格式验证一个数字并将其转换为(xxx)xxx-xxxx。 我认为这很好,因为那时人们可以使用他们习惯使用的任何格式输入任何10位数字的美国电话号码,并从中得到格式正确的号码。 以下是您可以放入MY_form_validation类的全部功能。 我希望我的表单允许空字段,所以如果你想强制一个值,你必须改变它。 function valid_phone_number_or_empty($value) { $value = trim($value) ...
-
电话号码验证中断(Broken Phone Number Validation)[2023-08-06]
对于给定的脚本,如果用户输入的字符数超过10个,则所有非数字字符都将被删除。 无论用户输入多少字符,我想你想要删除所有非数字字符? jQuery.validator.addMethod("phone", function(value, element) { var value = value.replace(/\D/ig,''); $(element).val(value) if(value.length > 10) { if(value.charA ... -
电话号码格式验证(Phone number formatting validation)[2022-05-12]
尝试 \+32\d{8,9} DEMO try \+32\d{8,9} DEMO -
PHP中的电话号码验证(Phone number validation in PHP)[2023-06-30]
您在问题( ^[0-9]$ )中提供的正则表达式只会匹配一个数字的电话号码。 至少您可能需要添加+修饰符以允许一个或多个数字: ^[0-9]+$ 要在开始处添加可选的+ ,您需要将其转义,因为+是正则表达式中的特殊字符: ^\+?[0-9]+$ 最后, \d是[0-9]缩写,因此您可以将表达式缩短为 ^\+?\d+$ The regex you provided in your question (^[0-9]$) will only match a one digit phone number. A ... -
由于您将整数定义为验证规则,因此无法输入带“ - ”的数字。 因此,验证将失败。 您需要使用RegEx,以便创建更复杂的验证。 有关详细信息,请参阅CI手册中有关验证的主题。 您的验证规则: $this->form_validation->set_rules('foo', 'Number', 'callback_number_validation'); Note how the keyword callback_ is used to identify CI your function for valida ...
-
为了检查电话号码是否确实存在(并且属于填写表单的用户) ,我只看到一个解决方案:尝试与该电话通信。 通常做的是将带有验证码的短信发送到电话号码 - 并要求用户在收到短信后输入该密码。 这样,你就可以确定: 电话号码存在, 并且属于当前用户。 当然,请确保您采取了一些安全措施,以防止任何人使用您的表单发送垃圾邮件: 确保一个用户每小时/每天不能发送超过X个短信, 确保每天/每周不能将超过2或3条短信发送到相同的号码 In order to check if a phone number really exis ...
-
验证电话号码的HTML(HTML Validation for phone numbers)[2022-02-06]
在HTML5中,您可以使用和 您还可以指定特定模式,例如 像pattern='^\+?\d{0,13}'会给你一个可选的+和最多13位数字 In HTML5 you can use codeigniter中的语言不能按预期工作(language in codeigniter doesn' t work as expected)- 在计算机拍照在哪里进入
- 使用cin.get()从c ++中的输入流中丢弃不需要的字符(Using cin.get() to discard unwanted characters from the input stream in c++)
- No for循环将在for循环中运行。(No for loop will run inside for loop. Testing for primes)
- 单页应用程序:页面重新加载(Single Page Application: page reload)
- 在循环中选择具有相似模式的列名称(Selecting Column Name With Similar Pattern in a Loop)
- System.StackOverflow错误(System.StackOverflow error)
- KnockoutJS未在嵌套模板上应用beforeRemove和afterAdd(KnockoutJS not applying beforeRemove and afterAdd on nested templates)
- 散列包括方法和/或嵌套属性(Hash include methods and/or nested attributes)
- android - 如何避免使用Samsung RFS文件系统延迟/冻结?(android - how to avoid lag/freezes with Samsung RFS filesystem?)
- TensorFlow:基于索引列表创建新张量(TensorFlow: Create a new tensor based on list of indices)
- 企业安全培训的各项内容
- 错误:RPC失败;(error: RPC failed; curl transfer closed with outstanding read data remaining)
- C#类名中允许哪些字符?(What characters are allowed in C# class name?)
- NumPy:将int64值存储在np.array中并使用dtype float64并将其转换回整数是否安全?(NumPy: Is it safe to store an int64 value in an np.array with dtype float64 and later convert it back to integer?)
- 注销后如何隐藏导航portlet?(How to hide navigation portlet after logout?)
- 将多个行和可变行移动到列(moving multiple and variable rows to columns)
- 提交表单时忽略基础href,而不使用Javascript(ignore base href when submitting form, without using Javascript)
- 对setOnInfoWindowClickListener的意图(Intent on setOnInfoWindowClickListener)
- Angular $资源不会改变方法(Angular $resource doesn't change method)
- 在Angular 5中不是一个函数(is not a function in Angular 5)
- 如何配置Composite C1以将.m和桌面作为同一站点提供服务(How to configure Composite C1 to serve .m and desktop as the same site)
- 不适用:悬停在悬停时:在元素之前[复制](Don't apply :hover when hovering on :before element [duplicate])
- 常见的python rpc和cli接口(Common python rpc and cli interface)
- Mysql DB单个字段匹配多个其他字段(Mysql DB single field matching to multiple other fields)
- 产品页面上的Magento Up出售对齐问题(Magento Up sell alignment issue on the products page)