Regular Expressions 101

Community Patterns

Community Library Entry

0

Regular Expression
ECMAScript (JavaScript)

/
(")?([^{:"]+)(")?(: )(")?([^,}"]+)(")?(, |}+)
/
g

Description

This Regex allows to add double-quotes to a JSON string that is missing them. It assumes we have a space after the ":" and also after the ",".

Submitted by anonymous - a year ago