Javascript mobile phone number Regular Expression verification function original

Copy codeThe Code is as follows:Function checkMobile (){Var sMobile = document. mobileform. mobile. valueIf (! (/^ 1 [3 | 4 | 5 | 8] [0-9] \ d {4, 8} $/. test (sMobile ))){Alert ("the first seven digits of a complete 11-digit mobile phone number or

Javascript text box verification code based on regular expressions

1, cannot be blank <Input type = "text" onblur = "if (this. value. replace (/^ + | + $/g, '') ='') alert ('cannot be blank! ') "> 2. Only English and numbers can be entered.<Input onblur = "if (/[^ 0-9a-zA-Z]/g. test (value) alert ('error')"

PHP Regular Expression verification of Chinese Characters

$ Str = '123456789abcdefg of the People's Republic of China ';Echo preg_match ("/^ [\ u4e00-\ u9fa5_a-zA-Z0-9] {} $", $ strName );Run the above Code to see the prompt information?Warning: preg_match (): Compilation failed: PCRE does not support \ L,

Practical Regular Expression learning notes

// Match the text, which is useful occasionally, but be careful when the character contains \ E$ Str = '[a-z]';$ Str = preg_replace ('/\ G [a-z] \ E/', '', $ str );Echo $ str; // print empty, all replaced, probably preg_quote Function// Name the

Implementation of a regular expression extraction example (. Net Asp Javascript/Js) for URLs, titles, and images

In some situations such as crawling and filtering, the advantage of the regular expression is obvious.For example, there are the following strings:Copy codeThe Code is as follows:<Li> <a href =

Java Regular Expression basics, collection of instance learning materials Daquan original

Regular Expression: Check whether the input email is valid. Date:The regular expression checks whether the access IP address is valid. Actual Application date:Js: Date Regular Expression and detection Date:Regular Expression, related link Date:Use

JavaScript Regular Expressions use detailed parameters

Regular Expression constructor: new RegExp ("pattern" [, "flags"]);Parameter description:Pattern -- a regular expression textFlags -- if it exists, it will be the following values:G: Global matchI: case insensitiveGi: combination of the aboveIn the

Detailed expression 4

For the newly added objects that are not regular expressions, see the corresponding Javascript Object Attributes.$ _ Attribute reference input$ * Attribute reference multiline$ & Attribute reference lastMatch$ + For details about attributes,

See a JS regular question.

Post it to encourage everyone.First read a piece of code,<Script>Var objReg =/^ [a-zA-Z] {1} (:) {1} $/gi;Alert (objReg. test ("a:"); // return trueAlert (objReg. test ("a:"); // return false</Script>Why does the second test return false?

Get started with RegEx! (For failing programmers) page 1/4

Regular ExpressionThis section compares with some concepts that most readers are already familiar with to describe the concept of regular expressions.This article is all about Microsoft documents.I would like to express my gratitude to those who

[Php] Five successful Regular Expressions

Regular Expressions are difficult to write, read, and maintain. Regular Expressions often incorrectly match unexpected texts or Miss valid texts. These problems are caused by the performance and ability of regular expressions. The ability and

Special characters in regular expressions in php

Character/Meaning: For characters, it usually indicates the literal meaning, indicating that the subsequent characters are special characters, not explained.For example:/B/matches the character 'B'. By adding a backslash (/B/) before B, the

Code for extracting code content using regular expressions

I studied it for one afternoon and had no clue. I came to the Forum for help and lost my old ID! I registered a new one! =. =!I want to use javascript regular expressions to extract SQL line expressions in asp code, but I cannot write or write them.

My regular expressions

1At least 8 characters". {8 ,}"2URLHttp: // ([\ w-] + \.) + [\ w-] + (/[\ w -./? % & =] *)?URL (2)^ [A-zA-z] +: // (\ w + (-\ w + )*)(\\. (\ w + (-\ w + )*))*(\\? \ S *)? $3Email\ W + ([-+.] \ w +) * @ \ w + ([-.] \ w + )*\. \ w + ([-.] \ w +

Clear the class name and style originality in tag p through script

Copy codeThe Code is as follows:<Textarea name = jb51 cols = 60 rows = 6><P class = MsoNormal style = "MARGIN: 0 cm 0 cm 0pt 0.05pt; TEXT-INDENT: 21pt; mso-char-indent-count: 2.0; mso-char-indent-size: 10.5pt "> <SPAN style ="

Several Basic concepts of Regular Expressions

I often see regular expressions, but I only talk about methods, but I seldom talk about the following basic concepts:1. Greedy: + ,*,?, {M, n} and so on are greedy by default, that is, as many matches as possible, also called the maximum matchIf ?,

Experience in deleting spaces on the left, right, or both ends of a string using regular expressions

We often encounter this situation when the front-end interacts with the background staff. We often need to obtain the user input information in the text box, and then submit it to the background through ajax or form. However, when a user inputs

Total Pages: 12206 1 .... 12202 12203 12204 12205 12206 Go to: GO
Tags Index:

Contact Us

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: and provide relevant evidence. A staff member will contact you within 5 working days.