Regular Expressions 101

Community Patterns

There does not seem to be anything here

Community Library Entry

0

Regular Expression
PCRE (PHP <7.3)

/
\G('(?>\\.|[^'])*'|NULL|(?>-?\d+(?>\.\d+)?))(?:,|(\z))
/

Description

This will parse the fields portion of a mysqldump lines such as:

INSERT INTO users VALUES (42,'Bob',12.34,NULL,'It's ok!');

Submitted by Steve Shreeve - 10 years ago