Regular Expressions 101

Community Patterns

PHP ReflectionParameter:__toString() parser

1

Regular Expression
PCRE (PHP <7.3)

/
^Parameter #\d+ \[ <(?:optional|required)> ([a-zA-Z_\x7f-\xff][a-zA-Z0-9_\x7f-\xff]*(?:\\[a-zA-Z_\x7f-\xff][a-zA-Z0-9_\x7f-\xff]*)*)(?: or NULL)? \$[a-zA-Z_\x7f-\xff][a-zA-Z0-9_\x7f-\xff]*(?: = NULL)? \]$
/
gm

Description

Submitted by Erin Millard - 11 years ago