Opened 11 years ago

Closed 11 years ago

#697 closed Support Requests (Fixed)

performance of boost::regex

Reported by: nobody Owned by: nobody
Milestone: Component: None
Version: None Severity:
Keywords: Cc:


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 

Cheers, Doris.

Attachments (0)

Change History (1)

comment:1 Changed 11 years ago by johnmaddock

  • Status changed from assigned to closed
Logged In: YES 

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.

Add Comment

Modify Ticket

Change Properties
Set your email in Preferences
as closed The owner will remain nobody.
The resolution will be deleted. Next status will be 'reopened'.

E-mail address and user name can be saved in the Preferences.

Note: See TracTickets for help on using tickets.