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
this post was submitted on 14 Nov 2022
4 points (100.0% liked)
General Programming Discussion
7803 readers
1 users here now
A general programming discussion community.
Rules:
- Be civil.
- Please start discussions that spark conversation
Other communities
Systems
Functional Programming
Also related
founded 5 years ago
MODERATORS
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.
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.