^(?2)(([ \n\r\t])(((?9)(?2):((?2)(?1)(?2)))(,(?2)(?4)))?}]|\(["\/bfnrt]|u[\da-fA-F]{4}))")|-?(0|[1-9]\d)(.\d+)?([eE][-+]?\d+)?|null)(?2)$
You must log in or register to comment.
A small set of regular expressions can tokenize JSON text – that’s what
lex
helps with, for example. However regular expressions cannot truly parse anything.JSON is not a regular language, so you can’t parse it using regex: https://cstheory.stackexchange.com/questions/3987/is-json-a-regular-language
When the kiddies talk about “regular expressions” these days they don’t mean it in the formal sense. They mean it in the sense of languages that evolved from regular expressions but which (badly) added features that go beyond regular languages.