Skip to content

Multiple vcards in single file or string not properly separated #13

Description

@keyboarder

The call to VCardHelper.SplitCards() not only failed for my initial test with multiple vcards in one file, but looking at the regex call, it is completely ineffective. Not only does it look like Regex.Split() is misunderstood, but the regular expression itself --using default options-- will not match any vcard. First of all, the Split function expects a pattern to match delimiters, not the full expression. Next, the default interpretation of the period (.) operator is all characters except \n. So immediately the pattern should fail to match any vcard with line breaks. But even if it did match line breaks, the * is by default greedy and will continue to match every character until the very last "END:VCARD", so it would still not separate multiple vcards.

I have already crafted a valid regex and can submit a change, but I'm completely new to contributing on github and also want to get feedback, since I would be surprised if absolutely nobody has tried importing a multi-vcard file or string.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions