|
Boost : |
Subject: Re: [boost] [xpressive] Compiler error; seems like normal usage?
From: Lars Viklund (zao_at_[hidden])
Date: 2012-03-13 12:48:27
On Tue, Mar 13, 2012 at 11:37:02AM -0500, Robert Dailey wrote:
> My regex is as follows:
> sregex re =
> "Content-Disposition:" >> +_s >> (s1=!"inline;") >> -*_ >>
> "size=" >> (s2=+_d) >> ';'
> ;
>
> This seems to be the part causing the compiler errors: (s1=!"inline;")
>
> When I change it to this: !(s1="inline;")
Negating a string literal coerces it to a false boolean. The underlying
language is still C++ with all its rules, no matter how cute you try to
make the DSL you glue on top.
> It compiles just fine. I'm on VS2008 SP1.
>
> Anyone know why the former usage does not work? I still want the group to
> capture an empty string if the string "inline;" does not match, which is
> why I put the ! inside the capture group. Does this matter?
-- Lars Viklund | zao_at_[hidden]
Boost list run by bdawes at acm.org, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk