略微加速

PHP官方手册 - 互联网笔记

PHP - Manual: Alternation and repetition

2024-11-13

Alternation and repetition

Alternation and repetition
SequenceGreedyDescription
...|...-Try subpatterns in alternation.
*yesMatch 0 or more times.
+yesMatch 1 or more times.
?yesMatch 0 or 1 times.
{n}noMatch exactly n times.
{n,}yesMatch at least n times.
{n,m}yesMatch at least n times but no more than m times.
*?noMatch 0 or more times.
+?noMatch 1 or more times.
??noMatch 0 or 1 times.
{n,}?noMatch at least n times.
{n,m}?noMatch at least n times but no more than m times.
{MACRO}-Include the regex MACRO in the current regex.
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.alternation.php

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