jQuery 检查虚假条目
我有一个用户必须填写的表单。有几个字段需要至少 50 个字符。我需要阻止用户输入超过 50 个句号或其他字母/数字。我已经成功地捕获了多个句号的输入,但是有人知道 JavaScript/jQuery 正则表达式可以按顺序查找 5 个或更多的任何字符吗?
预先非常感谢,
杰森
I have a form which the user has to fill in. A couple of fields are required to have a minimum of 50 characters. I need to stop the user from entering i.e. over 50 full stops, or another letter/number. I've managed to trap the entry of multiple full stops but does anyone know of a JavaScript/jQuery regular expression to find maybe 5 or more of any character in sequence?
Many thanks in advance,
Jason
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
试试这个:
这意味着:匹配任何字符,将其放入捕获组 1 中,并重复匹配该组 5 次或更多次。
Try this:
This means: match any character, place it in a capturing group 1, and match this group repeating 5 or more times.