in reply to Re^4: Regex: Identifying comments
in thread Regex: Identifying comments
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();