Boost logo

Boost Users :

From: John Maddock (john_maddock_at_[hidden])
Date: 2002-12-07 06:57:29


> Thank you very much, that is most likely the problem then. I'll try
> that and if I'm still having problems I'll post back here.
>
> The point you make is interesting however, because if you look at
> the first Regex:
>
> create table (_ID_) (\\(((\\s*,?\\s*_COL_\\s*)+)\\))
>
> It is essentially the same, but I have had no problems at all with
> it. Is it then safe to assume that the problem does not lie
> specifically with \s*,\s*, but somewhere deeper. Here is the actual
> regex that finally gets used (after the call to replaceMacros):
>
> ^(\s*insert(\s+into)?\s+([\w\-]+)(\s+\(((\s*(?:,?\s*)?([\w\-]+)\s*)+)
> \))?\s+values\s+\(((\s*,?\s*((\d+(\.\d+)?)|("[^"]*"))\s*)+)\)\s*;?)$
>
> I'm guessing it is something with:
>
> (\s+\(((\s*(?:,\s*)?([\w\-]+)\s*)+)\))?
>
> This one has a few more groupings than all the other regexs, but I
> can't seem to figure out the problem.
>
> BTW, during the course of writing this reply, I tested the
> expression with \s*(,\s*)? (as you can see above), and it still
> throws an exception.

I didn't really think that was the issue: it was an example of the kind of
thing that can trip you up, basically I'm trying not to get too deep into
your expression, but I think the comma separated list part is probably
messing you up, try something along the lines of:

\(\s*([^\s][^,]*?\s*,\s*)+\)

John Maddock
http://ourworld.compuserve.com/homepages/john_maddock/index.htm


Boost-users list run by williamkempf at hotmail.com, kalb at libertysoft.com, bjorn.karlsson at readsoft.com, gregod at cs.rpi.edu, wekempf at cox.net