Regular Expressions 101

Community Library Entry

0

Regular Expression
PCRE (PHP <7.3)

/
(?(DEFINE) (?<varchar> [[:alnum:]] | [-_] ) (?<funcname> [[:alpha:]](?&varchar)* ) (?<varname> \$(?&funcname) ) (?<typepart> [[:alpha:][[:alnum:]]*) (?<typename> \[ (?&typepart) ( \.(?&typepart) )* \] ) (?<arg> (?&typename)? \s* (?&varname) ) (?<arglist> (?&arg) ( \s*,\s* (?&arg) )* ) (?<args> ( \( (?&arglist)? \) )? ) (?<func_decl> ^ \s* function \s+ (?&funcname) \s* (?&args) \s* \{ ) ) (?&func_decl)
/
gxm

Description

Powershell function declaration (first line)

Submitted by @turboBasic - 7 years ago