, ') '
You can only enter full-width characters with regular expression restrictions:
/[^\uff00-\uffff]/g, ') '/[^\uff00-\uffff]/g, ') '
You can only enter numbers with regular expression restrictions:
/[^\d]/g, ') '/[^\d]/g, ') '
Use regular
]\d*$
G. Integer: ^-? [1-9]\d*$ Check character
A. Kanji: ^[\u4e00-\u9fa5]{0,}$
B. Letters and Numbers: ^[a-za-z0-9]+$ Special
A. Email address: ^\w+ ([-+.] \w+) *@\w+ ([-.] \w+) *\.\w+ ([-.] \w+) *$
B. Domain name: [a-za-z0-9][-a-za-z0-9]{0,62} (/.[ A-ZA-Z0-9][-A-ZA-Z0-9]{0,62}) +/.?
C. interneturl:[a-za-z]+://[^\s]* or ^http://([\w-]+\.) +[\w-]+ (/[\w-./?%=]*)? $
D. Mobile number: ^ (13[0-9]|14[5|7]|15[0|1|2|3|5|6|7|8| 9]|18[0|1|2|3|5|6|7|8| 9]) \d{8}$
E. Social Security Number (15-bit, 18-dig
. Integer: ^-? [1-9]\d*$ Checksum character
A. Chinese characters: ^[\u4e00-\u9fa5]{0,}$
B. Letters and numbers: ^[a-za-z0-9]+$ Special
A. Email address: ^\w+ ([-+.] \w+) *@\w+ ([-.] \w+) *\.\w+ ([-.] \w+) *$
B. Domain name: [a-za-z0-9][-a-za-z0-9]{0,62} (/.[ A-ZA-Z0-9][-A-ZA-Z0-9]{0,62}) +/.?
C. interneturl:[a-za-z]+://[^\s]* or ^http://([\w-]+\.) +[\w-]+ (/[\w-./?%=]*)? $
D. Mobile phone Number: ^ (13[0-9]|14[5|7]|15[0|1|2|3|5|6|7|8| 9]|18[0|1|2|3|5|6|7|8| 9]) \d{8}$
E. Identification number (
small partners must learn this piece of content.Reference Source:Js Regular ExpressionHttp://www.lai18.com/content/351738.htmlExtended ReadingJavaScript Regular Expression Series technical articles organize collections1 A good example of regular expression learning
ObjectivesWithin 30 minutes, you can understand what a regular expression is and have some basic knowledge about it, so that you can use it in your own program or webpage.
How to use this tutorial
The most important thing is-Please give me 30 minutes. If you have no experience using regular expressions, please do not t
Preface:I became interested in regular expressions half a year ago. I searched for a lot of information on the Internet, read a lot of tutorials, and finally found that his tutorial was very well written when I used regexbuddy, a regular expression tool, it can be said that it is the best
Preface:
I was interested in regular expressions six months ago. I found a lot of information on the Internet, read a lot of tutorials, and finally found that his tutorial was very well written when I used regexbuddy, a regular expression tool, it can be said that it is the best
Objectives
Within 30 minutes, you can understand what a regular expression is and have some basic knowledge about it, so that you can use it in your own program or webpage.How to use this tutorial
The most important thing is-Please give it to me30 minutesIf you have no experience using regular expressions, do not trySe
Objective:Half a year ago, I was interested in regular expressions, looked for a lot of information on the Internet, read a lot of tutorials, finally, when using a regular expression tool Regexbuddy, found that his tutorial is very good, it can be said that I have seen the best reg
delimiters, you need to escape these characters.
PHP Regular Expression delimiters
In most languages, regular expressions use "/" as the delimiter. in PHP, you can also use "#" to define the delimiter. If a string contains a large number of "/" characters, when "/" is used to define a boundary, you need to escape these "/", while "#" does not need to be escaped,
SELECT Note: If the need to introduce external JS need to refresh to perform]
It is clear from the above that when a regular expression has a "G" flag, the representative will handle the entire string, that is, the transformation of the function change will be applied to all matching objects. The function has three or more parameters, depending on the regular
, ') onbeforepaste=clipboarddata.setdata (' text ', Clipboarddata.getdata (' text '). Replace (/[^/u4e00-/u9fa5]/g, "))you can only enter full-width characters with regular expression restrictions: onkeyup=value=value.replace (/[^/uff00-/uffff]/g, ') onbeforepaste=clipboarddata.setdata (' text ', Clipboarddata.getdata (' text '). Replace (/[^/uff00-/uffff]/g, "))Use reg
Regular Expressions in PHP (i)
Hunte April 14, 2000
Email it to me. I'll talk about my opinion. Last article
PHP inherits *nix's consistent tradition of fully supporting formal expression processing. Regular expressions provide an advanced, but not intuitive, method for string matching and processing. Friends who have used
grep is known as one of the Three Musketeers of the text processing, although the Three Musketeers is the least functional and the simplest, but still can not be underestimated.The full name of grep is: Global search REgular expression and Print out of the line, which is: find the regular expression and display the mat
() function to remove the opening and closing blanks. Then we use Preg_replace () to remove the duplicates. \s represents any whitespace. (? =) indicates a forward lookup. It tastes like a character that matches only the characters that follow the same character as itself. So the regular expression means: "Any whitespace character followed by the whitespace character." "We replace them with blanks, so we r
]
var reg =/\w+/;
var str= ' regular tutorial ';
Alert (reg.exec (str));
Returns the complete string because Chinese is counted as a non-word character.Grouping and grouping referencesSee the regular topic section of the online videoRegular Expression Basics Third: grouping, grouping of references
]
var reg =/\w+/;
var str= ' regular tutorial ';
Alert (reg.exec (str));
Returns the complete string because Chinese is counted as a non-word character.Grouping and grouping referencesSee the regular topic section of the online videoRegular Expression Basics Third: grouping, grouping of references
Copy the Code code as follows:
Regular expressionsEreg Case Sensitiveif (Ereg ("([A-z]{3,})", "AAA")) {echo "uppercase can match!"";}else{echo "No";}if (Ereg ("([A-z]{3,})", "AAA")) {echo "Yes";}else{echo "Lowercase does not match!";}Eregi Case insensitiveif (Eregi ("([A-z]{3,})", "AAAA")) {echo "Case can match!";}Returns a matching valueif (Ereg ("^ (0[0-9]{2,3})-([0-9]{7,8})", "0592-5337138", $regs)) {echo "return value 0 subscript for the orig
The main reference to the bibliography tutorial
String.match ()
The match () method retrieves the target string to find one or more text that matches the regular expression RegExp. match () has two kinds of situations
:
1, if regexp has a flag G, match () Method performs a global search and finds all matching substrings in the targe
Http://dragon.cnblogs.com/archive/2006/05/09/394923.htmlObjective:This article is a sequel to the previous article, "The regular expression of simple words (a)", in this paper, we describe the group and backward references in regular expressions, the previous view, the condition test, the word boundary, the selector and other expressions and examples, and analyze
The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion;
products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the
content of the page makes you feel confusing, please write us an email, we will handle the problem
within 5 days after receiving your email.
If you find any instances of plagiarism from the community, please send an email to:
info-contact@alibabacloud.com
and provide relevant evidence. A staff member will contact you within 5 working days.