Regular Expressions 101

Community Patterns

Parsing json to split between names, values and delimiting characters

0

Regular Expression
PCRE (PHP <7.3)

/
(".*?"|(?<=:)[^"][0-9]*[^"{}\[\],])|[{}:\[\],]
/
g

Description

Splits json into 2 groups - values and delimiters of objects, arrays, pairs, names, values

Submitted by GigaMacRex - 7 years ago