Just another Perl shrine | |
PerlMonks |
Re: need to parse firts part of SQL-query (regex question)by KurtSchwind (Chaplain) |
on Jan 17, 2008 at 16:28 UTC ( [id://662912]=note: print w/replies, xml ) | Need Help?? |
This is a tricky bit of code. And you can use the tokenizer modules for SQL. However, another way is to take this in 2 steps. Using a temp variable for your sql, you could actually re-write the comas inside the concat to something else. Split on comas. And then take the part with the concat and return the values to comas again. For example, if you know you never have '#' characters in your sql, you could temporarily replace the comas in your concat to #s.
-- I used to drive a Heisenbergmobile, but every time I looked at the speedometer, I got lost.
In Section
Seekers of Perl Wisdom
|
|