在jQuery中,有没有函数/插件可以用来匹配字符串中给定的正则表达式?

For example, in an email input box, I get an email address, and want to see if it is in the correct format. What jQuery function should I use to see if my validating regular expression matches the input?

I've googled for a solution, but I haven't been able to find anything.

推荐答案

我相信这能做到:

http://bassistance.de/jquery-plugins/jquery-plugin-validation/

它有内置的模式,比如URL和邮箱地址,我想你也可以让它使用你自己的模式.

Jquery相关问答推荐

如果链接包含多个关键字,jQuery 将 HTML 添加到链接

更改高亮 colored颜色

为什么 .join() 不能与函数参数一起使用?

确定 Javascript/jQuery 中字符串的像素长度?

AngularJS 中的 ScrollTo 函数

如何使用 AJAX 和 jQuery 发布 django 表单

数据表警告(表 id = 'example'):无法重新初始化数据表

jQuery增量读取AJAX流?

Ajax 更新后在 jQuery 中重新绑定事件(更新面板)

jQuery 序列化不注册复选框

如何在 JQuery DataTable 中默认显示所有行

如何使div全屏?

模态窗口中的 Twitter Bootstrap Datepicker

获取跨域 iframe 的 DOM 内容

判断复选框是否未选中单击 - jQuery

如何隐藏 Twitter Bootstrap 下拉菜单

如何在 Bootstrap 中创建切换按钮

从客户端的对象数组中获取最新日期的优雅方法是什么?

为什么要使用发布/订阅模式(在 JS/jQuery 中)?

jQuery clone() 不克隆事件绑定,即使使用 on()