Boost logo

Boost Users :

From: John Maddock (john_at_[hidden])
Date: 2006-05-22 05:27:13


Christopher Hart wrote:
> I've run into a problem where I'm getting an "Invalid content of
> repeat range" when attempting to match a string using greediness and
> capture operators. I'm using the following function (basically taken
> from the "print captures" example in the regex docs):

> find_matches(html, "<p class=\"priceBest\"><a href=(.*?)>");

Your arguments are the wrong way around there, the expression works just
fine for me otherwise.

> The pattern I'm trying to match is working in Perl program (e.g. if
> ($html =~ m|<p class="priceBest"><a href=(.*?)>|gs) {...} ), so it
> seems like the pattern should be syntactically correct. I'm building
> on Mac OS X 10.4 (Intel) with Boost 1.33.1.

You might want to make the expression case insensitive in case the data has
<P> rather than <p>, and insert a \s* in between the <p> and the <a> just in
case....

Just a couple of random thoughts,

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