This time I will bring you a detailed graphic and text explanation of usingregular expressionsin jQuery. What are theprecautionsfor using regular expressions in jQuery? The following is a practical case. , let’s take a look.
Basic regular expressions
1. Creation of regular expressions
a) var checkNum = /^[A-Za-z0-9]+$/; b) var re=new RegExp(“["+s1+"]“,”g”);
2. Common rules
a) 用户密码:/^[a-zA-Z][a-zA-Z0-9_]{5,20}$/ b) 邮件:/^[\w-]+(\.[\w-]+)*@[\w-]+(\.[\w-]+)+$/ c) 手机:/^[\d]{5,20}$/ d) 其它常用验证:请百度
3. Method: test
Case
jquery ajax
Effect Demonstration Picture
I believe you have mastered the method after reading the case in this article. For more exciting information, please pay attention to other related articles on the php Chinese website!
Recommended reading:
Detailed analysis of matching single characters using regular expressions
Detailed explanation of the use of regular metacharacters
The above is the detailed content of Detailed graphic and text explanation of using regular expressions in jQuery. For more information, please follow other related articles on the PHP Chinese website!