in reply to Re^4: Regex: Identifying comments
in thread Regex: Identifying comments
umm..
No.
You will not see my regex fault with your examples. My regex will stumble with this sql.
update set bar = bar - 1 ; -- subtraction symbol may disappear.
I expected to see SQL parser solution in this thread, like this
At first I looked SQL::Parser. It seems quite near for such tasks, but I couldn't find good solution to rip off comments. Do you know such module?my $p = SQLParser->new(type=>'mysql', sql=>$sql) or die SQLParser->error(); $p->prettyprint(1); $p->without_comment(1); print $p->sql;
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^6: Regex: Identifying comments
by pvaldes (Chaplain) on Aug 31, 2012 at 15:32 UTC | |
by hbm (Hermit) on Sep 01, 2012 at 14:49 UTC | |
by Anonymous Monk on Sep 01, 2012 at 15:38 UTC |