Regular Expressions 101

Community Patterns

Community Library Entry

2

Regular Expression
PCRE (PHP <7.3)

/
^(([^";\n]*|"[^"\n]*");){4}([^";\n]*|"[^"\n]*");
/

Description

Fields terminated by ';' even if the fields are surrounded by " does not accept newlines. Change the central qualifier to get the column. if you want the Xth field write X-1 and use the 3° mathing group OR write X and use the 2° match.

Submitted by anonymous - 9 years ago