CSV Field
intermediateMatches individual fields in comma-separated value data.
csvparsingdatatabular
Pattern
/(?:"([^"]*(?:""[^"]*)*)"|([^,\r\n]*))/gTry It
0 of 4 strings matched
Explanation
Matches CSV fields: either a double-quoted string (with escaped double quotes as "") or an unquoted value terminated by comma, CR, or LF.
Test Strings
Matching
- "Hello, World"
- simple_value
- "She said ""hi"""
- 123
Non-matching
Language Compatibility
| Language | Support |
|---|---|
| JS | Full support |
| PYTHON | Full support |
| JAVA | Full support |
| PHP | Full support |
| GO | Full support |
Code Snippets
const regex = /(?:"([^"]*(?:""[^"]*)*)"|([^,\r\n]*))/g;
const text = "your text here";
const matches = text.match(regex);
console.log(matches);