Regular Expressions 101

Community Patterns

Community Library Entry

1

Regular Expression
PCRE (PHP <7.3)

/
(?:\s*(?:\"((?:[^\"]|\"\"|\\\")*)\"|\"([^\"]*)\"|([^,\r\n]+))\s*(?:,|[\r\n])?)+?
/
g

Description

Respects both "double-double" and "escaped doublequote" quotes in quotes. Respects newlines in quoted strings and as line-separators.

(see also RFC-4180)

Submitted by aes - 8 years ago