Regular Expressions 101

Community Patterns

Function arguments regex

0

Regular Expression
PCRE (PHP <7.3)

/
[^,()]+(?:\((?:(?R)(,(?R))*|[^,()]+|)\))?
/
g

Description

A simple regex to match individual arguments of a function.

Submitted by anonymous - a year ago