Boost C++ Libraries of the most highly regarded and expertly designed C++ library projects in the world. Herb Sutter and Andrei Alexandrescu, C++ Coding Standards

This is the documentation for an old version of boost. Click here for the latest Boost documentation.

C++ Boost


Standards Conformance

Boost.Regex Index


Boost.regex is intended to conform to the regular expression standardization proposal, which will appear in a future C++ standard technical report (and hopefully in a future version of the standard).  Currently there are some differences in how the regular expression traits classes are defined, these will be fixed in a future release.

ECMAScript / JavaScript

All of the ECMAScript regular expression syntax features are supported, except that:

Negated class escapes (\S, \D and \W) are not permitted inside character class definitions ( [...] ).

The escape sequence \u matches any upper case character (the same as [[:upper:]]) rather than a Unicode escape sequence; use \x{DDDD} for Unicode escape sequences.


Almost all Perl features are supported, except for:

\N{name}  Use [[:name:]] instead.

\pP and \PP






(?(condition)yes-pattern) and (?(condition)yes-pattern|no-pattern)

These embarrassments / limitations will be removed in due course, mainly dependent upon user demand.


All the POSIX basic and extended regular expression features are supported, except that:

No character collating names are recognized except those specified in the POSIX standard for the C locale, unless they are explicitly registered with the traits class.

Character equivalence classes ( [[=a=]] etc) are probably buggy except on Win32.  Implementing this feature requires knowledge of the format of the string sort keys produced by the system; if you need this, and the default implementation doesn't work on your platform, then you will need to supply a custom traits class.

Revised 24 Oct 2003

Copyright John Maddock 1998- 2003

Use, modification and distribution are subject to the Boost Software License, Version 1.0. (See accompanying file LICENSE_1_0.txt or copy at