Boost logo

Boost Users :

Subject: Re: [Boost-users] Regex question: is this a bug or a feature?
From: Jerry (jerry.jeremiah_at_[hidden])
Date: 2011-03-28 16:46:36


Kulti <kultihell <at> gmail.com> writes:

> Ramon F Herrera <ramon <at> patriot.net> wrote:
> > 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]*";
> >
> > The program is working fine now, after I am using these ones:
> >
> > const string number = "\\d+";
> > const string name   = "[A-z]\\w*";
> >
>
> Could you please read documentation before posting question?
>
http://www.boost.org/doc/libs/1_45_0/libs/regex/doc/html/boost_regex/syntax/cha
racter_classes/std_char_clases.html
> "w - Any word character (alphanumeric characters plus the underscore)"
>

Actually I don't think he was asking why w included underscores - I think he
was asking why that worked and his original character class based regex didn't.

Jerry


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