regexpp_diffs.qbk 2.6 KB

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