Fix parsing header lines where values are containing square bracket lists #107
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Two examples from the VCF 4.5 spec that demonstrate complex to 'parse' examples include
both of these show that it is a little tricky to parse correctly, as you cannot just split the text within the
<...>
by comma, and then split by =...To fix this, I used claude AI to help create the parseMetaString function. I first prompted the claude AI with a regex from here https://stackoverflow.com/a/18893443/2129219 which is quite complex already and told it to add support for the square brakets. It generated a non-working regex in the next step, but then i told it it didn't work and went into an infinite loop and it said, you're right, here is an alternative approach which is just a simple function that parses it out more precisely than the regex.
pretty smart. I credited the claude AI in the function