]>
Commit | Line | Data |
---|---|---|
7c673cae FG |
1 | [/ |
2 | / Copyright (c) 2008 Eric Niebler | |
3 | / | |
4 | / Distributed under the Boost Software License, Version 1.0. (See accompanying | |
5 | / file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) | |
6 | /] | |
7 | ||
8 | [section Appendix 3: Differences from Boost.Regex] | |
9 | ||
10 | Since many of xpressive's users are likely to be familiar with the _regexpp_ library, | |
11 | I would be remiss if I failed to point out some important differences between xpressive | |
12 | and _regexpp_. In particular:\n | |
13 | ||
14 | * `xpressive::basic_regex<>` is a template on the iterator type, not the character type. | |
15 | * `xpressive::basic_regex<>` cannot be constructed directly from a string; rather, you must use | |
16 | `basic_regex::compile()` or `regex_compiler<>` to build a regex object from a string. | |
17 | * `xpressive::basic_regex<>` does not have an `imbue()` member function; rather, the `imbue()` member | |
18 | function is in the `xpressive::regex_compiler<>` factory. | |
19 | * `boost::basic_regex<>` has a subset of `std::basic_string<>`'s members. `xpressive::basic_regex<>` | |
20 | does not. The members lacking are: `assign()`, `operator[]()`, `max_size()`, `begin()`, `end()`, | |
21 | `size()`, `compare()`, and `operator=(std::basic_string<>)`. | |
22 | * Other member functions that exist in `boost::basic_regex<>` but do not exist in | |
23 | `xpressive::basic_regex<>` are: `set_expression()`, `get_allocator()`, `imbue()`, `getloc()`, | |
24 | `getflags()`, and `str()`. | |
25 | * `xpressive::basic_regex<>` does not have a RegexTraits template parameter. Customization of regex | |
26 | syntax and localization behavior will be controlled by `regex_compiler<>` and a custom regex facet | |
27 | for `std::locale`. | |
28 | * `xpressive::basic_regex<>` and `xpressive::match_results<>` do not have an Allocator template | |
29 | parameter. This is by design. | |
30 | * `match_not_dot_null` and `match_not_dot_newline` have moved from the `match_flag_type` enum to the | |
31 | `syntax_option_type` enum, and they have changed names to `not_dot_null` and `not_dot_newline`. | |
32 | * The following `syntax_option_type` enumeration values are not supported: `escape_in_lists`, | |
33 | `char_classes`, `intervals`, `limited_ops`, `newline_alt`, `bk_plus_qm`, `bk_braces`, `bk_parens`, | |
34 | `bk_refs`, `bk_vbar`, `use_except`, `failbit`, `literal`, `perlex`, `basic`, `extended`, `emacs`, | |
35 | `awk`, `grep` ,`egrep`, `sed`, `JavaScript`, `JScript`. | |
36 | * The following `match_flag_type` enumeration values are not supported: `match_not_bob`, | |
37 | `match_not_eob`, `match_perl`, `match_posix`, and `match_extra`. | |
38 | ||
39 | Also, in the current implementation, the regex algorithms in xpressive will not detect | |
40 | pathological behavior and abort by throwing an exception. It is up to you to write efficient | |
41 | patterns that do not behave pathologically. | |
42 | ||
43 | [endsect] |