Quick start of regular Expressions (ii)
"Guided reading" in this article, we mainly introduce subpatterns, reverse reference (back references) and quantifiers (quantifiers)
In the previous article, we introduced the pattern modifiers and
PHP//regular expression//1. First regular expression if("a" = = "a"){ Echo"equal"; }Else{ Echo"noequal"; } Echo""; //the first parameter represents a matching pattern, and the second argument matches the string Echo(Preg_match(
1 OverviewGreedy and non-greedy mode affects the matching behavior of sub-expressions modified by quantifiers, and greedy mode matches as much as possible while the whole expression matches successfully, while not greedy mode matches as few as
Http://www.jb51.net/article/25313.htmRegular 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
Quantifier is a priority match, that is, quantifiers will eat as much as possible, until because of eating too many, resulting in the back can not match, just spit out a. For example, text AB1CD2, regular expressions. *[0-9] Matching process: *
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 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
1 overview
A regular expression (Regular Expression) is a matching pattern that describes the characteristics of a string of text.
Just as the words "tall" and "strong" in natural language are abstracted out to describe things, regular expressions
Oracle's formal expression is implemented in the form of various SQL functions and a WHERE clause operator. If you are unfamiliar with regular expressions, this article will give you an idea of this new, incredibly powerful, yet seemingly mysterious
1 overviewGreed and non-greedy mode affect the matching behavior of the subexpression modified by the quantifier, and the greedy pattern matches as many as possible on the premise that the whole expression matches successfully, and not the greedy
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.