Boost C++ Libraries: Ticket #697: performance of boost::regex https://svn.boost.org/trac10/ticket/697 <pre class="wiki">Is there any differenc between PERL and POSIX regarding the speed of the matching? does the flag match_posix affect it? Does regex implement Knuth-Morris-Pratt or any other string matching algorithm? Is there such in boost at all? Cheers, Doris. </pre> en-us Boost C++ Libraries /htdocs/site/boost.png https://svn.boost.org/trac10/ticket/697 Trac 1.4.3 John Maddock Sun, 30 Jul 2006 15:54:59 GMT status changed https://svn.boost.org/trac10/ticket/697#comment:1 https://svn.boost.org/trac10/ticket/697#comment:1 <ul> <li><strong>status</strong> <span class="trac-field-old">assigned</span> → <span class="trac-field-new">closed</span> </li> </ul> <pre class="wiki">Logged In: YES user_id=14804 Yes there is a difference between Perl and Posix style matching: Boost.Regex is basically a Perl style matcher that supports POSIX style matching as an optional extra. So Perl style matches are always faster in this implementation. Boost.Regex did previously use the Knuth_Morris-Pratt algorithm for regexes that have a string literal prefix. However, that code is currently disabled in the source. Believe it or not it's actually slower in practice than a simple table-based scan. HTH, John. </pre> Ticket