Regular Expressions: (? s) (? i)?: Meaning of expression

Source: Internet
Author: User
Tags modifier
This is the pattern modifier for the regular expression.
(? i) is not case-sensitive when matched. Indicates that the match is case-insensitive.

(? s) is Singleline (single-line mode). Represents the meaning of a change, which matches each character (including the newline character \ n).

(? m) is the multiline (multiline mode). Represents changing the meaning of ^ and $ so that they match at the beginning and end of any line, not just at the beginning and ending of the entire string. (In this mode, the exact meaning of $ is to match the previous position and the position before the end of the string.)
(? x): Indicates that if the modifier is added, the white space character in the expression will be ignored unless it has been escaped.
(? e): Indicates that this modifier is only useful for replacement and represents the PHP code in replacement.
(? A): Indicates that if this modifier is used, the expression must be the beginning of the matching string. For example, "/a/a" matches "ABCD".
(? E): In contrast to "M", means that if this modifier is used, "$" matches the end of an absolute string, rather than a newline character, which is turned on by default.

(? U): The expression is similar to the question mark and is used to set "greedy mode".


?: (。 A single question mark is not capture mode

Written as: (?:)

How to turn off the ability to capture parentheses.
And just use it to group, by adding the following in the left parenthesis:?
The first round bracket here is used for grouping only, not capturing variables.

"(?:\ \w+\\s (\\w+)) "

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.