,-4,12. You can only enter a negative integer expression that is not 0, ^\-[1-9][0-9]*$ describes an example that matches a negative integer matching non 0 -2,-23,-234 example of a mismatch 0, 4, 13. You can enter only n character expressions ^. {n}$ with ^. {4}$ is an example of a match n characters, note that Chinese characters only count 1 characters to match the example of 1234,12we,123 Qing, qingqing Moon mismatch example 0,123,123WWW,HTTP://BLOG.CSDN.NET/21ASPNET/14. You can only enter Eng
. Matches any one of the characters contained. For example, ' [ABC] ' can match ' a ' in ' plain '
[^XYZ]
Negative character set. Matches any character that is not contained. For example, ' [^ABC] ' can match ' P ' in ' plain '
[A-z]
The character range. Matches any character within the specified range. For example, ' [A-z] ' can match any lowercase alphabetic character in the ' a ' to ' Z ' range
[^a-z]
A negative character range. Matches any charact
other languages can use regular expressions, so it's not a Java patent.Because it has a separate system, it is relatively complex. The purpose of our learning of regular expressions is to be able to read and to write basic regular expressions is enough.The first reaction of the human brain, the format of a mailbox should be what, should be preceded by a user name, there is a @ in the middle, there is a domain name behind. com.Should we not impose a range that does not belong to the regular expr
line breakRe.findall (R ' ^c ', text)#[' C ')Re.findall (R ' ^c. ', text)#[' c+ ']3 + 1-inf matches one or more of the same values from 1---infinityRe.findall (R ' c+ ', text)#[' C ', ' C ', ' C ']Re.findall (R ' c\++ ', text)#[' C + + ']4 $ end matches last characterRe.findall (R ' C $ ', text)5 [] or refers to orRe.findall (R ' p[a-za-z]+ ', text) #匹配p字符后面是 (A-Z) lowercase characters A-Z and uppercase A-Z character #{1,} matches 1 to infinity#[' py
The checksum is all made up of numbers
Funtin Isigit (s) {var patrn=/^[0-9]{1,20}$/; if (!patrn.x (s)) Rturn Fals Rturn Tru}
Javasript Form validation mail to determine whether an input is mailbox mail and implemented through regular expressions.
Check Mail mailbox
Funtin Ismail (str) {var RG =/^ ([a-za-z0-9_-]) +@ ([a-za-z0-9_-]) + ((\.[ a-za-z0-9_-]{2,3}) {
*[1-9]\d*$ or ^ ([0-9]+\.[ 0-9]*[1-9][0-9]*) | ([0-9]*[1-9][0-9]*\. [0-9]+) | ([0-9]*[1-9][0-9]*)) $ Negative floating point number: ^-([1-9]\d*\.\d*|0\.\d*[1-9]\d*) $ or ^ (-([0-9]+\.[ 0-9]*[1-9][0-9]*) | ([0-9]*[1-9][0-9]*\. [0-9]+) | ([0-9]*[1-9][0-9]*))) $ Floating-point number: ^ (-?\d+) (\.\d+)? $ or ^-? ([1-9]\d*\.\d*|0\.\d*[1-9]\d*|0?\.0+|0) $ Two, an expression that verifies the character Kanji: ^[\u4e00-\u9fa5]{0,}$ English and numeric: ^[a-
Do you understand regular expressions in this way? the regular expressions written by others are as follows:
If (! Preg_match ('/^ [\ w \-\.] + @ [\ w \-\.] + (\. \ w +) + $/', $ _ string ))
I understand the brackets and their meanings as follows: Brackets indicate any of them;
Then, [\ w \-\.] in the above section can be understood as the first one that can be followed by any English character, horizontal bar, or dot.
If the above understanding is correct, the problem arises. the purpose of t
remaining 8 digits are numbers.
In the preceding expression, only the first 3 invoice numbers that are lowercase letters can be matched, and if we enter uppercase letters, we cannot match them. So to make sure that the first 3 letters are case-insensitive, we'll use the expression ^[a-za-z]{3}.
^[a-za-z]{3}[0-9]{7}$Can we verify the simple URL format?
First step: Check for the existence of www:
^www.Th
", "A2C" such as String, you can also create multiple intervals, such as "[A-za-z]" can match any uppercase and lowercase letters, "[a-za-z0-9]" can match any uppercase or lowercase letters or numbers.(): The expression that is enclosed in () is defined as "group", and the character that matches the expression is saved to a staging area, which is useful when the string is extracted. To represent some charac
The universe shines on the dragon, 13:00:33Oh, by the way, create a regular expression.13:00:46 AMRegular Expression?The universe shines on the dragon, 13:00:58Only numbers and letters are allowed, and numbers and letters are required.13:13:21 AM^ [A-zA-Z0-9] + $The universe shines on the dragon, 13:17:14123456The universe shines on the dragon, 13:17:22In this way, he is satisfied.The universe shines on the dragon, 13:17:26AsdfghThe universe shines on
In this paper, the regular library of C regex and Pcre in the domain validation of the scene to do the evaluation.The regular expression that validates the DNS domain name is:"^[0-9a-za-z_-]+ (\\.[ 0-9a-za-z_-]+) * (\\.[ A-za-z]{2,}\\.) $"Regular validation processing is done for 6,177,578 logs in the normal DNS request log.1,pcreThe version number of the pcre us
See others write the regular is as follows:
if (!preg_match ('/^[\w\-\. +@[\w\-\.] + (\.\w+) +$/', $_string))
In the middle brackets and inside of the understanding, I am like this: the brackets denote any one of them;
Well, it [\w\-\] in the above paragraph. I understand that the first one in the front can be any English characters, or bars, or dots.
If the above understanding is correct, then the problem comes, this code is to verify the correctness of the email.
People know that the first e
advice is to try not to. Write custom validation, if required. I will introduce the following, there is really enough pain in the egg. Because of this kind of problem, I write the form will not appear type= "email" type= "url" type= "number" and so on, if NG solves this problem. I'm going to update it again.
Status of the form
nbsp; ng-pattern= "/^" ([a-za-z0-9]+[_|\_|\.]?) *[a-za-z0-9]+@
Example
The code is as follows
Copy Code
function test (){var temp = document.getElementById ("Text1″");Verification of e-mailvar myreg =/^ ([a-za-z0-9]+[_|\_|\.]?) *[a-za-z0-9]+@ ([a-za-z0-9]+[_|\_|\.]?) *[a-za-z0-9]+\.[a-za-z]{2,3}$/;if (!myreg
emailRules:The basic mailbox format is *****@**.**@ It used to start with a uppercase/lowercase letter or number, followed by a string of 0 to multiple uppercase/lowercase letters, numbers, or. _-@ Followed by. is a string of 1 to multiple upper and lower case letters or numbers. Followed by a string of 1 to multiple upper and lower case letters, numbers, or.*/$ Zhengze = '/^ [a-zA-Z0-9] [a-zA-Z0-9. _-] *
Basic JS Regular Expressions (Classic full) and js Regular Expressions
// Check whether it is composed of digits
Funtin isigit (s) {var patrn =/^ [0-9] {1, 20} $/; if (! Patrn. x (s) rturn fals rturn tru}
Use the regular expression to verify mail and determine whether the input is email mail.
// Check the mail mailbox
Funtin ismail (str ){Var rg =/^ ([a-zA-Z0-9 _-]) + @ ([a-zA-Z0-9 _-]) + ((\. [a-
Mailbox verification code is mostly a domain name or a letter user name that cannot be verified by a letter, such as: I @fufuok.com or fufu@9.cn. The solution is as follows:
1. Do not judge the total length. You can add the total length;
2. Supports domain name suffixes such as .net.cn and .com.cn;
3. The mailbox name must start with a letter or number and can contain "-" and "_" in the middle;
4. The domain name must start with a letter or number, with the "-" and "_" characters in the middle;
Chapter 4 data processing-php regular expression-zheng AQI (continued). For more information about learning php regular expressions, see. Php regular expressions are good applications.
Chapter 4 data processing-php regular expression-zheng AQI (continued). For more information about learning php regular expressions, see. Php regular expressions are good applications.
1. Basic knowledge of Regular ExpressionsMeaning: String mode consisting of common characters (a-z) and special characters
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.