Boost logo

Boost Users :

From: Derrick Schommer (schommer_at_[hidden])
Date: 2007-02-15 19:59:43


I'll give that a try, thanks. Just cannot see why is it that .{1,3}
doesn't have the same effect given the only difference is the
exclusion of a 'b'.

Thanks,

Derrick

2007/2/15, Darren Garvey <lists.drrngrvy_at_[hidden]>:
> Hi Derrick,
>
> On 15/02/07, Derrick Schommer <schommer_at_[hidden]> wrote:
> > Hi,
> >
> > I'm trying to understand if a regular expression I've designed is
> > working correctly. It seems that I can make the regular expression
> > match work "off by one" character in certain circumstances. For
> > instance:
> >
> > The pattern: ".{1,3}" finds 1 to 3 characters, however
> >
> > The pattern: ".[^b]{1,3}" finds 1 to 4 characters...?
> > <dice>
>
> The reason the second patter finds 1-4 chars is because you've asked for '.'
> (any character) followed by [^b]{1,3} (1-3 of any character except b). If
> you want 1-3 of anything except b, then just "[^b]{1,3}" is all you need.
>
> hth,
> Darren
>
>
>
> _______________________________________________
> Boost-users mailing list
> Boost-users_at_[hidden]
> http://lists.boost.org/mailman/listinfo.cgi/boost-users
>


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