Perl/Python regular expressions vs. Boost.regex?

Rob Williscroft rtw at
Thu Oct 23 21:36:33 CEST 2008

 wrote in news:mailman.2906.1224773327.3487.python-list at in

> A colleague wrote a C++ library here at work which uses the
> Boost.regex library.  I quickly discovered an apparent problem with
> how it searches. Unlike re.match the regex_match function in that
> library effectively anchors the match at both the start and the end. 
> Can other people confirm this? 
> Thx,
> Skip Montanaro

Quoting from : <url:


Note that the result is true only if the expression matches the whole of 
the input sequence. If you want to search for an expression somewhere 
within the sequence then use regex_search. If you want to match a prefix of 
the character string then use regex_search with the flag match_continuous 

So yes it does.


More information about the Python-list mailing list