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,2}) $/;Rturn rg.tst (str);}
Verify Login Name: Can only enter 5-20 letters beginning wi
Match Chinese: [\u4e00-\u9fa5]
English letter: [A-za-z]
Number: [0-9]
Match Chinese, English letters and numbers and _:
^[\u4e00-\u9fa5_a-za-z0-9]+$
At the same time determine the input length:
[\u4e00-\u9fa5_a-za-z0-9_] {4,10}
^[\w\u4e00-\u9fa5\uf900-\ufa2d]*$
1, a regular expression, contains only Chinese characters, numbers, letters, underscores can not be the beginning and end of the underscore:
^(?! _)(?!. *?_$) [a-za-z0-9_\u4e00-\u9fa5]
Common Regular Expressions in JS and regular expressions for verification time, and regular expressions for js Verification
In this article, I have compiled 12 extremely useful regular expressions, which are a favorite of WEB developers.
1. You can only enter the amount in the input box. In fact, you can only enter num
It is the fortress that every programmer can't get around, only it is attacked. I think the reason is difficult, the first difficulty is to need memory, the second difficulty is to have abstract logical thinking.
Signed on the Internet too much of the introduction is a fierce essay, while looking at the understanding can help memory not. Also by Wubi font root table formula "managed to watch 32 Jin ..." Inspiration,
Try "Regular Expression mnemonics"
Differences between regular expression creation methods and simple regular expression compiling methods (js learning summary), regular expression js
In the literal mode, all the content we wrap between them are metacharacters, and some have special meanings. Most of them are common metacharacters that represent their meanings.
var name = 'wo'; var reg = /^\d
Take the mailbox verification, most people on the Internet write the mailbox validation regular expression code can not verify this mailbox:
i@julying.com, nor can you verify xxxxxx@i.com .
Last I found that youku.com (Youku) User registration has this problem, see figure:
JavaScript's RegExp objects and string objects define methods that use regular expressions to perform powerful pattern matching and text retrieval and substitution functions.
In JavaScript, regular expressions are represented by a RegExp object. Of course, you can use a regexp () constructor to create RegExp objects, or you can use JavaScript A new special syntax added in 1.2 to create the RegExp object. Ju
1 overviewThis may be a confusing, even confusing topic, but that is why the discussion is necessary.
In regular, some characters that have special meaning, or sequences of characters, are called Meta characters, such as "?" Indicates that the decorated subexpression matches 0 or 1 times, and that "(? i)" indicates that the matching pattern of the case is ignored, and so on. And when these meta characters are required to match themselves, the escape p
In this article, I've written 12 very useful regular expressions, which is a favorite of web developers.
1. In the input box can only enter the amount, in fact, can only enter a maximum of two decimal digits//The first type in input box limit
2. Verify the mailbox format
var reg=/\w+ ([-+.] \w+) *@\w+ ([-.] \w+) *\.\w+ ([-.] \w+) * * *;
var email=$ ("#email"). Val ();
if (!reg.test (email)) {
alert ("Please enter the mailbox acc
In this case, the regular expression optimization, mainly for the current commonly used NFA pattern regular expressions, in detail can be referred to: regular expression matching parsing process analysis (regular expression matching principle). From the above example, we can infer that the influence NFA class
http://zhangyanyansy.blog.163.com/blog/static/135305097201042110756638/
Basic knowledge of JavaScript regular expressions
1 JavaScript regular object creation and usage declaration JavaScript regular Expressions
var recat = new RegExp ("cat");
You can also
var recat =/cat/; Perl Style (recommended)
2 learning the most commonly used test exec match search replace
A string can only contain Chinese and English characters, numbers, and php regular expressions of #039;- #039;, #039; _ #039. Use the preg_match () function. A string can only contain
Chinese and English, numbers ,'-','_'Php regular expression. Use
Preg_match ()Function.
Reply content:
A string can only containChinese and English, numbers ,'-','_'Php regular
Regular expressions can:• Test a pattern for a string. For example, you can test an input string to see if there is a phone number pattern or a credit card number pattern in the string. This is called data validation
• Replace text. You can use a regular expression in your document to identify specific text, and then you can delete it all, or replace it with another text
• Extracts a substring from a string
separate lexical analysis as a module.However, the rules listed in the table above are described in vernacular, and we want to be able to describe them in a formal language so that the computer can process them automatically. Regular Expressions are an ideal choice.Everyone in the daily programming estimates are more or less exposed to regular expressions, using it to match strings, etc., may also be famil
This article is a sequel to the detailed introduction of regular expressions (above) in the previous article, in this article, we describe the groups and backward references in regular expressions, previous views backward, conditional testing, word boundaries, selectors, and other expressions and examples, and analyzed the internal mechanism of the regular engine
Although the code is not much, but simple and clear
Copy Code code as follows:
Preg_match ('/^ (?!) String)/', ' aa ') = = True
This is used to verify that a string does not start with a ' string '.
In Perl or in the language of regular expressions that support Perl (such as PHP), you can do this with a front-view declaration:
Copy Code code as follows:
Preg_match ('/.* (?!) \.txt) $/', ' AA ')
It means matching all names
The following are new objects that are not regular expressions see properties for the corresponding JavaScript object
$_ attribute Reference input
$* Property Reference Multiline
$ Property Reference Lastmatch
$+ Property Reference Lastparen
$ ' attribute reference Leftcontext
$ ' attribute reference Rightcontext compile method
Methods for compiling regular expression objects belonging to RegExp during sc
The following is about the small series for everyone to collect and organize the regular expression of PHP, the specific content please see below detailed
$str = Preg_replace ("/(
It uses three sub modes (one in each parenthesis), the first is the link start tag, the second is the link text, and the third is
Then \1, \2, and \3 in the second argument means that these three parts, what to replace it is not easy?
Get the PHP function
[Regular] Perl regular expressions completely match the regular expression of a word. how to write (forward) This post is last written by default7 from 2014-10-2709: 30: 18. how does one implement the Sublime or many editing software's search function to completely match words? ** Nbsp; * nbsp; @ param nbsp; $ str nbsp; [
I. Overview of regular expressionsIf you have not used regular expressions before, you may not be familiar with this term or concept. However, they are not as novel as you might think.
Recall how you found the file on your hard disk. Are you sure you will use it? and * characters to help find the file you are looking for. The character matches a single character in the file name, while the * matches one or
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.