CSV processing regular expression

38 views
Skip to first unread message

krishs patil

unread,
Mar 3, 2014, 7:00:15 AM3/3/14
to re...@googlegroups.com
Hello guys,
 
I am reading C# class which reads and parse csv files based on csv delimiter. I have stumbled on regular expression used to split tokens -
 
could anyone help me to decipher what does the follwing regular expression does.
 
Delimiter = ';'
new Regex(Delimiter + "(?=(?:[^\"]*\"[^\"]*\")*(?![^\"]*\"))");
 
Thanks in advance.

 

Prashant Patole

unread,
Mar 5, 2014, 11:06:35 PM3/5/14
to re...@googlegroups.com
Hi,

Install and use 'Ultra Picio Expresso'.

you will be able to read and operate on regular expressions.

Inline image 1


--
--
Sub, Unsub, Read-on-the-web, tune your personal settings for this Regex forum:
http://groups.google.com/group/regex?hl=en

---
You received this message because you are subscribed to the Google Groups "Regex" group.
To unsubscribe from this group and stop receiving emails from it, send an email to regex+un...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.

Prashant

unread,
Mar 5, 2014, 11:01:04 PM3/5/14
to re...@googlegroups.com

Install/use 'ultra picio expresso'.

Then u LL b able to read expression's meaning and even operate on it with ease.


Prashant

WWW.supersimplesoft.com

Sent from my ASUS Fonepad

iiz

unread,
Jun 27, 2014, 8:32:48 AM6/27/14
to re...@googlegroups.com

 
Delimiter = ';'
new Regex(Delimiter + "(?=(?:[^\"]*\"[^\"]*\")*(?![^\"]*\"))");

the regex has the delimiter as a paramter. In this case it uses a semicolon, so the full regex would be
(?=(?:[^\"]*\"[^\"]*\")*(?![^\"]*\"))")

I do not know what you are trying to do exactly, but for getting a split you use this logic
seems easier
 
 

Reply all
Reply to author
Forward
0 new messages