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.
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
Reprinted from: http://blog.csdn.net/kkobebryant/article/details/267527
Basic syntax for regular expressions
First, let's take a look at two special characters: ' ^ ' and ' $ ' they are used to match the beginning and end of the string,
Regular expressions do not seem as important as a language or technology. You cannot write an application only by using them. However, they are always used in your development process, whether for form verification, highlighting search results, or
First, ArraysFor the tool class for array manipulation, some methods for array sorting and binary searching are provided.Common methods:1. public static string toString (Int[] a): Converts an array of type int to a string.Converted to a string after
Regular expression: finds, replaces, and extracts operations on information in a string. (Comments and blanks are not supported, must be written on one line)creation of regular expressions: characters contained between a pair of slashes
Objective
A regular expression (regular expression) describes a pattern of string matching that can be used to check whether a string contains a seed string, replaces a matching substring, or extracts a substring from a string that matches a
One: The math object performs common arithmetic tasks. The commonly used math methods are:Round (a): Rounding aRandom (): Random number (0,11)Math.floor (Math.random () *11))Max (A, b): Output a large value in a, b
Two: JavaScript RegExp
TestedMatching double-byte characters (including Chinese characters): [^ \ x00-\ xFF] is very useful and recommended
2 recommended web http://mscenter.edu.cn/blog/yongsheng/archive/2004/11/19/308.html
This guy has a lot of regular expressions.
There are two ways to define regular expressions in JS: normal way, constructor modeThe regular object is the built-in object of JSThe properties of the regularThe regular methodThe method of string in JSOne, ordinary way (double slash//mode): var
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.