I'm trying to parse a simple JSON object.
{"difficult:name and value with commas":"99,9%;100,00%","b":"very important value","date":"01/01/2023 21:00:00","object members":4}
My pattern"([^\[\]\{\}]+)":"*([^\[\]\{\}]+)"* doesn't return the result I expect.
By excluding the symbols "[]{}", I want to exclude values that contain arrays or objects, and I need just a simple value pair.
I'd like to have four matches and two submatches (name,value) for each match.
| match | submatch1 | submatch2 | comments |
|---|---|---|---|
| "difficult:name and value with commas":"99,9%;100,00%" | difficult:name and value with commas | 99,9%;100,00% | name and a string value I'd like to get without covering quotes "", but It's a guess that values may contain inner quotes |
| "b":"very important value" | b | very important value | also, it can be a comma inside the value, if it's not restricted by JSON standard |
| "date":"01/01/2023 21:00:00" | date | 01/01/2023 21:00:00 | |
| "object members":4 | object members | 4 |
This is the result of my torment at https://regex101.com/:
I use VBA, but it's more about the pattern.
