Regular Expressions for Perl

Source: Internet
Author: User

1, "." : Any single character (except ' \ n ');

2, "*": match the preceding paragraph 0~n times;

3, "+": match the preceding paragraph 1~n times;

4, "?" : Match the preceding 0~1 times;

5.1, "\1" or "\2": Reverse reference;

5.2, "\g{n}": direction reference, if N is negative, then the relative response reference;

6, "|" : "or" match;

7.1, "[]": Character set single character matching;

7.2, "[^]": Reverse character set single character matching;

8.1, "\d": [0-9] (Reverse matching: "\d"); "[\d\d]": Any character (including ' \ n ');

8.2, "\w": [a-za-z0-9_] (Reverse matching: "\w");

8.3, "\s": [\f\t\n\r] (Reverse matching: "\s"); ( note the last space );

8.4, "\h": [\ t]; (match the horizontal blank, note the last space )

8.5, "\v": [\f\n\r]; (Matching vertical blanks)

8.6, "\ r": Cross-artificial system break match;

9, "//" or "m//" or "m<>" or "m%%" and so on: pattern matching;

10.1, "I": case-insensitive modifier;

10.2, "/S": Enable "." Match ' \ n ' modifier;

10.3, "/x": Ignore the pattern blank and comment (' # ' after part);

11.1, "^": Beginning anchor position;

11.2, "$": line tail anchor position; ("\^\s*$\": matches any blank line)

11.3, "\b": Word anchor position (with ' \w ' as the standard, direction matching \b); ("\bansersion" and "\bansersion\b" match: Ansersiona, ansersion__ab134, but former match ansersion , the latter does not match )

12, "=~": binding operation;

13, "($val)": Use variables;

14, "$" or "$" and so on: "()" mode capture variables;

Regular Expressions for Perl

Related Article

Contact Us

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

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.