Title |
Test
Find
CSV Parser
|
Expression |
((?:[^",]|(?:"(?:\\{2}|\\"|[^"])*?"))*) |
Description |
Very simple (but very useful!) regex to split CSV files. It does not drop the commas - you have to do that manually. Quotes are dealt with properly and escaped quotes are ignored. Matches from sample:this is ;a;"line,\"in\"a";csv;file |
Matches |
this is ,a,"line,\"in\",a",csv,file |
Non-Matches |
" |
Author |
Rating:
Alex Forencich
|
Source |
|
Your Rating |
|
Title: Not CSV
Name: Andy
Date: 4/24/2007 7:30:24 AM
Comment:
This is a uesful format to split, however it is not CSV.
CSV doubles the quotes to escape them (check wikipedia).
Title: Worked for me in C#, but I had to escape the embedded double quotes
Name: Rovert Prohaska
Date: 3/27/2007 4:34:00 PM
Comment:
Worked for me in C#, but I had to escape the embedded double quotes. Nice job.
Thanks.