Boost logo

Boost Users :

Subject: Re: [Boost-users] Regex question: is this a bug or a feature?
From: John Maddock (boost.regex_at_[hidden])
Date: 2011-03-28 04:25:42


> My pattern matching was failing when I had these definitions, which I
> happen to prefer:
>
> const string number = "[0-9]+";
> const string name = "[A-z][A-z0-9]*";
>
> ("name" is supposed to match a typical variable name)
>
> The program is working fine now, after I am using these ones:
>
> const string number = "\\d+";
> const string name = "[A-z]\\w*";
>
> The only difference that I aware of, is that the second form accepts
> underscores as part of variable names.

Correct there should be no difference - do you have a test case?

Thanks, John.


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