The Lounge is rated Safe For Work. If you're about to post something inappropriate for a shared office environment, then don't post it. No ads, no abuse, and no programming questions. Trolling, (political, climate, religious or whatever) will result in your account being removed.
I don't mind if you say "JSON object", I know what you mean, but when someone clarifies your terminology and you talk down to them as if it is them that doesn't understand rather than you, then...yeah, I'mma gonna get real pedantic
The reason I pointed it out to you is because you were speaking as if you didn't know they are different, and like I said, I think it's an important thing to be aware of... so I made you aware of it.
Also, being corrected about something isn't "talking down".
Well, it depends what you are trying to do with it. Regexes aren't exactly brilliant performance wise: Counting Lines in a String[^] - which makes sense when you think just how "general purpose" they are.
I'd suspect that a specific-to-JSON solution would be a damn sight more efficient.
Sent from my Amstrad PC 1640 Never throw anything away, Griff
Bad command or file name. Bad, bad command! Sit! Stay! Staaaay...
AntiTwitter: @DalekDave is now a follower!
And remember that .net's Regular Expression engine is far richer than most, so you may not be describing a generally-applicable technique.
I've been working at loading data from JSON files to SQL Server for only about a year now. I convert JSON to XML on-the-fly and pass the XML elements to SQL Server for further processing and storage -- using SQL Server's built-in XML functions.
In my situation, it's all about getting data from file to table as quickly as possible (with an eye toward not hogging resources) and I never need to have all the objects in memory at once.
Like you, IO seems to be the main bottleneck, with writing to the database being slower than reading from the disk.
I'm targeting .NET so I'm not worried about it. If I were to port it to anything it would be something that at least used PCRE which is about as rich as .NET's regex, IIRC
But yeah, I'm looking at going arbitrarily deep. If I can't do it using nested group captures I'll do it by allowing you to define a pseudo-JSON document where each of the values is a regex expression instead of an actual value.
When I was growin' up, I was the smartest kid I knew. Maybe that was just because I didn't know that many kids. All I know is now I feel the opposite.