Boost logo

Boost Users :

From: Eric Niebler (eric_at_[hidden])
Date: 2006-10-02 20:30:21


David Jenkins wrote:
> I've been using Xpressive and think it's great. But, I think the
> following program shows two problems.
>
> Problem 1: You get a runtime error if you uncomment the line
> "std::wcout << what2.position(0) << L'\n';"

Looks like you found a bug. position() doesn't work on nested_results.
I'll look into it. Thanks for the report.

> Problem 2: I think it should output:
> This is my face
> is
> my
> face
>
> But it actually outputs:
> This is
> is

The pattern is:
> wsregex subtokens = +alnum;
> wsregex token = as_xpr(L"This ") >> subtokens;

So, token will match "This " following by 1 or more alpha-numeric
characters. The match stops after "is" because the next character is a
space, which is not alpha-numeric.

> Note that if you replace the nested regular expression with the
> (commented out) non-nested one, it still outputs the wrong thing. It
> outputs "This is" instead of "This is my face."
> Here is the program. Thanks for your help.

Same thing. Not a bug.

-- 
Eric Niebler
Boost Consulting
www.boost-consulting.com

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