Regular Expressions 101

Community Patterns

Community Library Entry

0

Regular Expression
Created·2015-07-13 08:11
Flavor·PCRE (Legacy)

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

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