Boost logo

Boost Users :

Subject: Re: [Boost-users] How efficient is the boost::regex library?
From: Jeroen Habraken (vexocide_at_[hidden])
Date: 2011-10-28 10:03:32


On 28 October 2011 00:20, Alec Taylor <alec.taylor6_at_[hidden]> wrote:
> Thanks John. I would be interested in seeing comparisons of
> boost:regex with other regex libraries.

This might also be of interest,
http://boost-sandbox.sourceforge.net/libs/xpressive/doc/html/boost_xpressive/appendices/perf.html.
Note that it's "lies, damn lies, statistics, and benchmarks" though.

> Yesterday I found a fuzzy logic string regex library. Does the
> boost::regex library support this?
>
> On Fri, Oct 28, 2011 at 5:10 AM, John Maddock <boost.regex_at_[hidden]> wrote:
>>> I am looking for the most efficient open-source C++ regex library.
>>>
>>> Reading this article: http://swtch.com/~rsc/regexp/regexp1.html - It
>>> seems that GNU awk is the best overall:
>>> http://pdos.csail.mit.edu/~rsc/regexp-img/grep1p.png
>>
>> This is all true, but also completely irrelevant.  DFA's have good worst
>> case behaviour, but can be many times slower for common cases.  It's also
>> impossible to implement a DFA matcher that offers the full range of Perl
>> regular expression features (if you think it can be done, congratulations,
>> you've just proved that P==NP).
>>
>> It's also possible to protect the regex engine against runaway "bad"
>> expressions and bail out in those cases (this is what Boost.Regex does, it
>> throws an exception if the complexity of obtaining a match grows too fast).
>>
>>> How does the boost::regex library compare?
>>>
>>> Would you recommend boost::regex as the most efficient one, or would
>>> you suggest another?
>>
>> There's no such thing as best - it all depends on the data being searched
>> and the particular regular expression.  In addition since most
>> Perl-compatible libraries use much the same algorithm they're all broadly
>> similar albeit with different quirks.
>>
>> HTH, John.
>> _______________________________________________
>> Boost-users mailing list
>> Boost-users_at_[hidden]
>> http://lists.boost.org/mailman/listinfo.cgi/boost-users
>>
> _______________________________________________
> Boost-users mailing list
> Boost-users_at_[hidden]
> http://lists.boost.org/mailman/listinfo.cgi/boost-users
>

Jeroen


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