Extended Regular Expressions: extended regular expressions make their functions more powerful on the basis of basic regular expressions, but their mota functions are basically the same. The differences between them are as follows: ^ The first line Identifier $ the last line identifier. match one character * matches zero or multiple leading characters. For example, * love matches the mode after 0 or multiple spaces. l
Extension Regular ExpressionExpression:
Extension Regular ExpressionMake basic regular expressions more powerful.
However, mota is basically the same. The following describes
Differences:
^ First line Locator
$ Line tail Locator
. Match one character
* Matches zero or multiple leading characters. For example, '* love' matches 0 characters.
Or line with the pattern love after multiple Spaces
[] Match any one of the group of characters
[^] Match characters in a character group that are no longer specified
+ Match the characters before one or more plus signs, for example, '[a-z] + ove'.
Find moving, approve, love, xxxove, etc.
? Match 0 or a leading character 'lo? Ve can find out love or lve
A | B matches a or B, such as love | hate, to find love, hate, or rows that contain love and hate.
() Match character groups, such as 'Love (abe | ly) (ov) + 'match lovable or lovely
Once or multiple times of ov matching, I created a zz file under/tmp/and experimented with the above mota experiments on this file: 1. The use of the plus sign matches the characters 2 and? In one or more plus signs ,? Used to match 0 or a leading character: 3, a | B, used to match a or B or string containing a and B: 4 ,() matching character groups in parentheses: The above is a simple introduction to the extension Regular Expression and the test operation, and will be modified occasionally in the future.
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.
A Free Trial That Lets You Build Big!
Start building with 50+ products and up to 12 months usage for Elastic Compute Service