J
JMosey
I have a string of select vars from a SQL query
i.e. Select first, second, third, fourth from table...
I can get the part "first, second, third, fourth" just fine.
I then turn that into a list which is used elsewhere.
My problem is when someone does this:
Select first, second AS NumberTwo, third, mytable.fourth from table...
For the use I have for that srting I grab, the AS and . cause problems.
I can say what I want the regex to do, but I have having a terrible
time writing it.
first, I'd like one to strip out all text backwards from "AS" until the
previous comma (i.e. make ", second AS NumberTwo," just ", NumberTwo,"
secondly, I'd like one that does the same thing with the period (i.e.
make ", mytable.fourth," just ", fourth,"
Finding the "AS" and "." are in grasp, but searching/removing backwards
until the previous "," is a pain at this point.
Is this even possible? Do I need to break my string into chunks at the
comma and approach it that way?
i.e. Select first, second, third, fourth from table...
I can get the part "first, second, third, fourth" just fine.
I then turn that into a list which is used elsewhere.
My problem is when someone does this:
Select first, second AS NumberTwo, third, mytable.fourth from table...
For the use I have for that srting I grab, the AS and . cause problems.
I can say what I want the regex to do, but I have having a terrible
time writing it.
first, I'd like one to strip out all text backwards from "AS" until the
previous comma (i.e. make ", second AS NumberTwo," just ", NumberTwo,"
secondly, I'd like one that does the same thing with the period (i.e.
make ", mytable.fourth," just ", fourth,"
Finding the "AS" and "." are in grasp, but searching/removing backwards
until the previous "," is a pain at this point.
Is this even possible? Do I need to break my string into chunks at the
comma and approach it that way?