Community Patterns

Community Library Entry

-2

Regular Expression
Created·2015-10-23 16:41
Flavor·Python

r"
,(?![^\[\]]*(?:\([^[]]]*\])?\])|,(?![^\{\}]*(?:\([^\{\}]]*\})?\})|\{|\}
"
g
Open regex in editor

Description

matches only those commas that are between sets, or between members of a set. does not match commas that are inside members.

Submitted by Amrit Kohli