This paper mainly introduces the regular expression capturing group and the non-capturing group of PHP, and explains the difference between the regular expression capturing group and the non-capturing group of PHP through an example. We hope to help
This article mainly introduces the regular expression capturing group and non-capturing group in php. if you need a regular expression, you can refer to the regular expression frequently used during project development, it can be said that regular
This article mainly introduces the regular expression capturing group and non-capturing group in php. If you need a regular expression, you can refer to the regular expression frequently used during project development, it can be said that regular
Mastering regular expressions is a basic requirement for every programmer, and for each beginner, a string of characters from the regular expression will get dizzy. Bloggers will be so, has been the regular expression of a kind of inexplicable fear.
PHP Regular Expression capturing group and non-capturing group, PHP regular expression
Mastering regular expressions is a basic requirement for every programmer, and for each beginner, a string of characters from the regular expression will get
Capture GroupSyntax:
Character
Description
Example
(Pattern)
Match pattern and capture the result. The group number is automatically set.
(Abc) + dMatch abcd or abcabcd
(? Name>Pattern)Or(? 'Name'Pattern)
In the project development process is often said to use, can be said that regular expression is the most basic requirements of each programmer, beginners in just contact with regular expressions are very difficult. A friend's blog recently saw a lot
Capturing groups
Grammar:
character
Describe
Example
(pattern)
Matches the pattern and captures the result, setting the group number automatically.
(ABC) +dMatch ABCD or ABCABCD
The Regex class represents a regular expression that is not mutable (read-only). It also contains a variety of static methods that allow you to use other regular expression classes without explicitly creating instances of other classes.
Overview of
C # Regular expression notation pattern
Characters
Description
\
An escape character that escapes a character with special functionality to a normal character, or vice versa
^
Match the
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.