in reply to Re^2: Regexp in mysqldump
in thread Regexp in mysqldump

I was creating a parser, and I already created one for another project, but then I discovered that mysqldump uses backticks (`) for table name and field names, and standard ticks (') for values in insert and update statements.

For this reason a standard regexp does the job.

I've tried the first solution, and works perfectly at a first glance... I'll try hopefully tonight the second one...

Replies are listed 'Best First'.
Re^4: Regexp in mysqldump
by JavaFan (Canon) on Apr 16, 2010 at 15:57 UTC
    For this reason a standard regexp does the job.
    Nope. That reason is not enough on its own. It breaks on things like:
    `fieldname` varchar(255) default 'Got you `haha haha`!',
    Just because MySQL uses different quotes doesn't mean quotes cannot be contained inside other quotes.