Regular Expressions 101

outer Parentheses

Open Workspace
  • PCRE (Legacy)
  • Match
4

Regular Expression

/
(\((?:([^\(\)]*)|(?:(?2)(?1)(?2))*)\))
/

Description

Finds the outermost pair of parentheses. Compatible with any amount of nesting

Submitted by Jonas Gerneth