some time ago I created a program for processing vCard files. This can be done almost completely as follows:
(?<FIELD>[^\s:;]+)(;(?<PARAM>[^:]+))*:(?<CONTENT>.*(?>\r\n[ \t].*)*)$
However, this does not work for the new (August 2011) vCard 4.0 standard. The problem is that vCard 4.0 files use the following layout:
FIELD(:)(;([PARAMETER]="[CONTENT],[MORE CONTENT]"(;))[DATATYPE(:)]:)CONTENT[newline]
eg.
ADR;type="home,work":(address)
As you can see, I would like to capture the entire parameter, including the material type = "...".
So my question is: can my code be changed or will I have to write two processes (one for old types and one for the new version 4.0, ideally, I would like to support both), and if so, how? (By the way, I am using C # and .net 4.0).
Sincerely.
source share