Regular Expressions 101

Community Patterns

Regex

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 - 8 years ago