The article to share the PHP regular Expression Security Tutorial Foundation, this article will continue to extend the knowledge of PHP regular expressions, see below for details.
Operation Precedence for various operators of PHP regular
Regular Expressions Learning Notes
A regular expression (regular expression) describes a pattern of string matching that can be used to check whether a string contains
There is a seed string, a matching substring is substituted, or a substring is
First, the reader guide
The Reader guide helps you master the outline of this article. Lest you read most of it to understand this article is not suitable for you, causing you visual pollution.
If you are using ASP to write programs, or you are
Characters
Meaning: For a character, it is usually indicated by literal meaning that the character followed by a special character is not interpreted.
For example:/b/matches the character ' B ', which becomes a special character by adding a
Here are some examples of regular expressions that you might encounter:
/^\[\t]*$/"^\[\t]*$" matches a blank line.
/\d{2}-\d{5}/"\d{2}-\d{5}" verifies that an ID number consists of a 2-bit character, a hyphen, and a 5-digit number.
/.*/".*" matches
Only numbers can be entered: "^[0-9]*$".Only n digits can be entered: "^\d{n}$".You can enter at least n digits: "^\d{n,}$".You can enter only the number of m~n digits:. "^\d{m,n}$"Only numbers beginning with 0 and not 0 can be entered: ^ (0|[ 1-9][0
1, defining regular Expressions
1 There are two forms of defining regular expressions, one is the normal way, the other is the constructor method.2 normal way: var reg=/expression/Additional parameterExpression: A string that represents a rule in
The concept of regular expressions:A string used to match and process text. People often use patterns to represent actual regular expressions. Regular expressions are created by the regular expression language. Regular expression language is a "mini"
A few days ago, there is a need to import data in Excel into the database, originally thought to use the program to read the data in Excel and stored in the database, but a friend of the reminder that the use of editplus or ultraedit such tools to
the Regex class includes methods such as IsMatch, Match, matches, Replace, and Split . If you use the ^ and $ enclosing tags, it indicates that the entire string (not just the substring) must match the regular expression.
The 1.Match method matches
Recommended reading: JavaScript form verification length
JavaScript Form validation-Submitting a form
JavaScript form Validation-the first recognition of regular expressions
In the previous article to introduce JavaScript form validation-the
[0]5 type of data:
[0.1] Basic data type: Undefined, Null, Boolean, number, String
The [0.1.1] base type value refers to a simple data segment in which 5 basic types are accessed by value because the actual values stored in the variable can be
When to use regular expressions.
In the process of program development, it is often necessary to perform the matching, searching, extracting, replacing and judging of the text content repeatedly. If the individual only use code to achieve the
Programming | network | syntax rules and tags for regular regular expressions
Now we formally enter the expression of learning, I will be based on the example of a combination of regular expression of the use, after reading you will feel that
A. Convert numbers into strings
①number class definition of ToString () method: This method can receive an optional parameter representing the conversion cardinality (radix, range between 2~36), and if this argument is not specified, the conversion
Regular
The early origins of regular expressions
The "ancestors" of regular expressions can be traced back to early studies of how the human nervous system works. Warren McCulloch and Walter Pitts, two neuroscientists, have developed a mathematical
Regular
\Marks the next character as a special character, or a literal character, or a back reference, or a octal escape character. For example, ' n ' matches the character ' n '. ' \ n ' matches a newline character. Sequence ' \ ' matches ' \ ' and
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.