Boost logo

Boost Users :

From: Dean Brettle (dean_at_[hidden])
Date: 2003-04-27 23:15:25


Hi,

Out of curiosity, will the result of your fix be:

1. "a{1}b" is *not* found in any string consisting of more than 1 "a"
followed by a "b",

Or,

2. "a{1}b" *is* found (albeit at the next to last position) in every string
consisting of 1 or more "a"s followed by a "b".

Thanks for all your hard work on boost::regex!

--Dean

----- Original Message -----
From: John Maddock
To: Boost-Users_at_[hidden]
Sent: Saturday, April 26, 2003 5:15 AM
Subject: Re: [Boost-Users] Inconsistent regexp matching when using
quantifiers?

> I'm using regexp from boost-1.28 and experience the following
> behavior. Consider the following (somewhat artificial) regexp
> pattern:
>
> a{1}b
>
> As I expected, that pattern is found in "ab" but not "aab".
>
> To my suprise however, the same pattern *is* found
> in "aaab", "aaaaab", and any other string consisting of an odd number
> of "a"s followed by a "b". It is not found in strings consisting of
> an even number of "a"s followed by a "b". This seems odd (no pun
> intended).
>
> I see the same sort of behavior with quantifiers other than "{1}" and
> where the quantified expression matches other single characters.
> (Oddly enough, the behavior changes when using a quantified
> expression that matches multiple characters. "(ab){1}c" is found
> in "abc", "ababc", "abababc", and any other string containing "abc".)

I can verify that - I'll try and get it fixed in the next version as it is a
very definite bug :-(

Thanks for reporting that one,

John Maddock.

Yahoo! Groups Sponsor

Info: <http://www.boost.org>
Wiki: <http://www.crystalclearsoftware.com/cgi-bin/boost_wiki/wiki.pl>
Unsubscribe: <mailto:boost-users-unsubscribe_at_[hidden]>

Your use of Yahoo! Groups is subject to the Yahoo! Terms of Service.


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