Regular Expressions 101

balanced parenthesis match

Open Workspace
  • JavaScript
  • Match
-1

Regular Expression

/
([{\(\[<]*)[^{\(\)}\[\]]*([\)}\]>]*)
/
gmyi

Description

break the code to first opening parenthesis and then closing use the groups individually not entirely . This is 40% correct online pattern but mixing it with first open then close groups in two different matches result in 100% success

Submitted by Muhammed