Regex To Match Characters Between The Last Parentheses

A regular expression to extract any characters between the last two parentheses (round brackets).

A regular expression To match any characters between two parentheses (round brackets).

\(([^)]*)\)[^(]*$

Matches:

  • The last two parentheses (round brackets)
  • The last (two) parentheses (round brackets)

Non-matches:

  • The last two parentheses [round brackets]
  • The last two parentheses “round brackets”
  • The last two parentheses ’round brackets’

See Also: