略微加速

PHP官方手册 - 互联网笔记

PHP - Manual: Grouping

2024-12-20

Grouping

Grouping
SequenceDescription
(...)Group a regular expression to override default operator precedence.
(?r-s:pattern) Apply option r and omit option s while interpreting pattern. Options may be zero or more of the characters i, s, or x.
Options
OptionDescription
iCase insensitive.
-iCase sensitive.
sAlters the meaning of '.' to match any character whatsoever.
-sAlters the meaning of '.' to match any character except '\n'.
xIgnores comments and whitespace in patterns. Whitespace is ignored unless it is backslash-escaped, contained within ""s, or appears inside a character range.
These options can be applied globally at the rules level by passing a combination of the bit flags to the lexer.
(?# comment )Omit everything within (). The first ) character encountered ends the pattern. It is not possible for the comment to contain a ) character. The comment may span lines.
add a noteadd a note

User Contributed Notes

There are no user contributed notes for this page.

官方地址:https://www.php.net/manual/en/parle.regex.grouping.php

北京半月雨文化科技有限公司.版权所有 京ICP备12026184号-3