Boost logo

Boost Users :

Subject: Re: [Boost-users] Regex alternation in xpressive
From: OvermindDL1 (overminddl1_at_[hidden])
Date: 2010-03-11 07:26:31


On Thu, Mar 11, 2010 at 3:57 AM, Surya Kiran Gullapalli
<suryakiran.gullapalli_at_[hidden]> wrote:
>
>
> On Thu, Mar 11, 2010 at 15:58, OvermindDL1 <overminddl1_at_[hidden]> wrote:
>>
>> On Thu, Mar 11, 2010 at 2:29 AM, Surya Kiran Gullapalli
>> <suryakiran.gullapalli_at_[hidden]> wrote:
>> >     >> ("st"|"nd"|"rd"|"th") ;
>>
>> That is because "st"|"nd"|etc... you are trying to 'or' two string
>> constants, that makes no sense in C++.  You need to 'infect' the whole
>> line by wrapping the first one with as_xpr as:
>>      >> (as_xpr("st")|"nd"|"rd"|"th") ;
>
> Thanks, it worked. I thought the first as_xpr would infect everything. but i
> was mistaken.

You enclosed all of those in parenthesis which created a new 'scope'
(not by the technical definition, but it works here), thus you need to
're-infect' anew since they get run together before the external
definition. :)


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