S
Stephan Rose
Having some trouble with a regex that I hope someone can help me with.
The data I am processing looks as follows:
15 items per dataset. Most datasets are on only 1 line of text,
however on occasion a few text fields are multi-line making the
dataset span more than 1 line.
Each data item is surrounded by ", and the items are seperated by a ;.
The last item however is not terminated with a ;.
There are no quotes within quotes.
So basically the whole thing looks like this:
"1";"2";"3";..."15"
The regex I came up with almost works the way I need it to, however on
occasion some data items are empty resulting in ""; and in that case
my regex just skips it and doesn't return a match. That of course
throws off the position of the next data items and everything goes all
bad...I would need it to return a 0 length string for those items.
Can anyone help me with what I need to modify to make this work? Here
is the current regex: [^\"]*[^\";]
I am very tempted to just go do it the old fashioned way manually, but
if I can get this regex to work, that would be nicer.
Thanks all!
The data I am processing looks as follows:
15 items per dataset. Most datasets are on only 1 line of text,
however on occasion a few text fields are multi-line making the
dataset span more than 1 line.
Each data item is surrounded by ", and the items are seperated by a ;.
The last item however is not terminated with a ;.
There are no quotes within quotes.
So basically the whole thing looks like this:
"1";"2";"3";..."15"
The regex I came up with almost works the way I need it to, however on
occasion some data items are empty resulting in ""; and in that case
my regex just skips it and doesn't return a match. That of course
throws off the position of the next data items and everything goes all
bad...I would need it to return a 0 length string for those items.
Can anyone help me with what I need to modify to make this work? Here
is the current regex: [^\"]*[^\";]
I am very tempted to just go do it the old fashioned way manually, but
if I can get this regex to work, that would be nicer.
Thanks all!