Regular Expressions 101

Community Patterns

JSON trailing comma match

0

Regular Expression
PCRE2 (PHP >=7.3)

/
(?!"[^"]*)(,\s*[\]}])(?![^"]*")
/
gm

Description

Don't rely on this for any serious business, though.

Submitted by Basix - 2 years ago