I am having trouble with parsing my delimited string with the following regex (this regex also takes into account situation, when user is using quotes as a grouping character):
"[^"]*"|[^;]*
This works perfectly fine when there is no empty space between the delimiter, such as following:
31.12.2015;M234;94 841,00;C
**results:**
31.12.2015
M234
94 841,00
C
However it fails, when some of the 'columns' / values are empty such as following:
31.12.2015;M234;94 841,00 ;C;;;0000-0000-00;0000000
The problem is, that it does not return empty space between my delimiters as a result and simply skips to a new delimiter.
What do I need to change to fix this regex?
Here is the code I am using to loop through values
For Each Match In sRegex.Execute(sRow)
If Match.Length > 0 Or bDelimiter = False Then
Debug.Print Match.Value
sHolder(UBound(sHolder)) = Match.Value
ReDim Preserve sHolder(0 To UBound(sHolder) + 1)
bDelimiter = True
Else
bDelimiter = False
Debug.Print "delimiter"
End If
Next Match