I’m not sure if you should use regular expressions in this case. This really gets complicated.
The format you are trying to parse looks a lot like CSV. There are many free libraries out there that can parse CSV files. Perhaps you should check if there is any library that fits your needs.
But you could also do the parsing yourself. This should be very easy if you read character by character. Whenever you hit a ", switch into some kind of string-literal mode. If you find a , and are not in string-literal mode, you found a new column. That’s just a simple state machine.
Viewing 2 posts - 1 through 2 (of 2 total)
The forum ‘PrettyFaces Users’ is closed to new topics and replies.
Comments are closed.
Do you play Magic?
Get TopDecked MTG, the #1 Magic App, built by players, for players. Free to use, forever.