Regular Expressions 101

Community Patterns

Community Library Entry

1

Regular Expression
PCRE (PHP <7.3)

/
(?:\bfunction\s+(\w+)\([^()]*\)\s*\{|(?!^\G))(?:(?!\bfunction\s+\w+\([^()]*\)\s+{|}\h*\r?\n).)*?\$body\s*->\s*(\w+)|function\s*(.+?)\(
/
sg

Description

tristate

Submitted by karan - 9 years ago