3 ms·
I wonder if the script created by the author would go through edge cases of JSON, like escaped characters. I doubt and this sounds like a famous joke to me:
by p0w3n3d 3y ago
I wonder if the script created by the author would go through edge cases of JSON, like escaped characters. I doubt and this sounds like a famous joke to me:
Do you wanna hear a joke?
Parsing XML with regexp
I did it too. But this was nightmare
- geocrasher 3y agoAuthor here. Definitely not. I wrote it to parse the already very nicely formatted output that I had. For example to get value B so I could search replace based on value D, when values A,B,C,D, are in order on separate lines. valueb=$(grep D $json -B2| grep B) now valueb = B when I started with D, and I can sed 's/B/D/' pretty easily. Now, the JSON I got were a big giant blog as it often is, I'd have had to at least use gron, which is a nifty tool I learned about by posting this here, and for that I'm grateful!
- p0w3n3d 3y agoThanks. For known cases I would probably do the same. But I've already burnt my hand with these regexps so many times, I feel itchy when I see a brick. Also lost some files due to `cut` + unexpected spaces, but this is another story
- deleted 3y ago[deleted]