Regular Expressions 101

Community Library Entry

1

Regular Expression
PCRE (PHP <7.3)

/
(?:^|,)(?=[^"]|(")?)"?((?(1)[^"]*|[^,"]*))"?(?=,|$)
/
g

Description

Parse an input string into fields separated by comma.

Submitted by anonymous - 9 years ago