Compare commits

...

1412 Commits

Author SHA1 Message Date
82a28cf859 Rework as esp-idf component 2023-11-23 17:17:05 +01:00
e5979ae1af Correct windows_gcc CI runner. 2022-06-27 09:14:55 +01:00
72f81888a5 Merge pull request #173 from boostorg/overflow_fix
Fix for numeric overflow found during fuzzing.
2022-04-08 17:22:08 +01:00
ae7819ddb1 Fix for numeric overflow found during fuzzing. 2022-04-06 17:52:09 +01:00
7898582330 Document standalone mode in readme. 2022-03-08 11:31:13 +00:00
86126cc09d Update history, regenerate docs.
[CI SKIP]
2022-03-08 11:26:26 +00:00
66a98ce786 Merge pull request #172 from boostorg/no_cache_fix
Fix for building with BOOST_REGEX_MAX_CACHE_BLOCKS=0.
2022-03-08 11:12:59 +00:00
fe84f0bcc5 Update CI. 2022-03-08 09:40:16 +00:00
76e7a4218e Fix for building with BOOST_REGEX_MAX_CACHE_BLOCKS=0.
Also fix some msvc warnings in test_sets.cpp.
Add test case.
Fixes the issues in https://github.com/boostorg/regex/pull/171
2022-03-07 16:32:43 +00:00
a9f18c2c03 Update history and regenerate docs. 2021-11-05 17:18:10 +00:00
09d0e434dd Correct directory typo. 2021-10-20 18:54:34 +01:00
e4923f1cfe Add static_assert as a CMake dependency.
As it's now used by core.
2021-10-20 18:38:39 +01:00
c91684ca1f Merge pull request #164 from zhangyiru/develop
sync PR 162 and PR 163 to v4
2021-10-20 18:06:23 +01:00
23712c386b Merge pull request #165 from boostorg/issue152
Correct stack unwinding inside recursions when seeing (*SKIP).
2021-10-20 17:01:53 +01:00
354e02f141 Correct stack unwinding inside recursions when seeing (*SKIP).
Fixes https://github.com/boostorg/regex/issues/152.
2021-10-20 12:12:57 +01:00
13ba033116 sync PR 162 and PR 163 to v4 2021-10-15 10:36:47 -04:00
75600e3519 Merge pull request #163 from boostorg/issue151
Disallow repeating a case-change group.
2021-10-14 11:48:09 +01:00
b10c089aba Disallow repeating a case-change group.
Turn assertion into an error.
Fixes: https://github.com/boostorg/regex/issues/151
2021-10-13 17:59:56 +01:00
2be85f36ee Merge pull request #162 from boostorg/issue153
Collected fixes for Issue 153
2021-10-13 08:58:52 +01:00
d1b4834b9b Merge branch 'patch-2' of https://github.com/zhangyiru/regex into issue153 2021-10-12 19:23:46 +01:00
1d17ca9d5d Add tests for https://github.com/boostorg/regex/issues/153
Make runtime errors, regex_error's.
2021-10-12 19:23:18 +01:00
b5cb9b7a99 Merge pull request #161 from boostorg/icu_cmake
Update ICU testing and usage.
2021-10-10 19:31:37 +01:00
fe72f473f3 Correct test directory path.
Minor doc update.
2021-10-10 18:25:50 +01:00
e1057e777d Fix CMake command line. 2021-10-10 17:36:23 +01:00
5b0d054eeb Don't build on push and PR. 2021-10-10 16:43:36 +01:00
a99e2c3b2c Update documentation for ICU usage.
Regenerate docs.
2021-10-10 16:41:19 +01:00
fc25325cd2 Update ICU testing and usage. 2021-10-10 15:51:51 +01:00
eb573a72d8 Merge pull request #160 from boostorg/issue133
Allow back references to refer to a capture that hasn't happened yet …
2021-10-09 19:51:15 +01:00
1e524968bb Fix missing #include, fix test cases. 2021-10-09 16:43:53 +01:00
a013cf3c5f Remove dead #include. 2021-10-08 17:47:42 +01:00
74347b95af Allow back references to refer to a capture that hasn't happened yet ("forward reference").
Fixes https://github.com/boostorg/regex/issues/133.
2021-10-08 14:51:01 +01:00
732d9755bd Merge pull request #159 from boostorg/issue123
Change \B to be the opposite of \b.
2021-10-08 11:05:56 +01:00
10cff29314 Change \B to be the opposite of \b.
Also update docs.
Fixes https://github.com/boostorg/regex/issues/123.
2021-10-07 18:52:27 +01:00
78bf0acd20 Merge pull request #158 from boostorg/winapi
Remove windows.h dependency.
2021-10-06 11:10:18 +01:00
6050fa4fd4 Add some more windows checks, remove outdated CI tests
(Xenial is no longer supported).
2021-10-06 08:41:00 +01:00
e68f82c346 Remove windows.h dependency. 2021-10-05 19:55:01 +01:00
248c69d68b increase used_block_count when use put_mem_block
increase used_block_count when use put_mem_block in unwind_extra_block
2021-09-18 14:26:14 +08:00
b7f44de3c5 Merge pull request #149 from Dani-Hub/develop
#148: icu_regex_traits::translate_nocase doesn't use case-folding
2021-08-15 18:34:24 +01:00
f7a2c7a7a7 Merge branch 'develop' of https://github.com/Dani-Hub/regex into develop 2021-08-12 22:08:36 +02:00
5ad8906e91 #148: icu_regex_traits::translate_nocase doesn't use case-folding
In translate_nocase replace u_tolower by u_foldCase(c, U_FOLD_CASE_DEFAULT) suitable for single codeunit case folding
2021-08-12 22:07:57 +02:00
142d4434e4 #148: icu_regex_traits::translate_nocase doesn't use case-folding
In translate_nocase replace u_tolower by u_foldCase(c, U_FOLD_CASE_DEFAULT) suitable for single codeunit case folding
2021-08-08 18:29:12 +02:00
dfd700d858 Merge pull request #142 from boostorg/issue140
Fix infinite loop in parser.
2021-06-26 18:26:07 +01:00
d312a085b1 Fix infinite loop in parser.
Fixes: https://github.com/boostorg/regex/issues/140.
2021-06-26 13:52:23 +01:00
194ab4d646 Merge pull request #139 from volo-zyko/fix-clangcl-icu-linking
Fix linking with ICU libs when building with clang-cl
2021-06-12 14:22:21 +01:00
1728f98485 Merge pull request #138 from volo-zyko/add-icu-search-paths
Add ICU libs search paths even when ICU_ICUUC_NAME, ICU_ICUDT_NAME, and ICU_ICUIN_NAME are provided by user
2021-06-12 14:22:02 +01:00
5e42d51d49 Merge pull request #137 from volo-zyko/icu-data-dir
Fix ICU libs detection when ICU resources are in a separate directory
2021-06-12 14:21:39 +01:00
151c144b75 Merge pull request #135 from Kojoley/prune-iostream-includes
Prune <iostream> includes
2021-06-11 18:21:35 +01:00
f4c21ba011 Merge pull request #134 from Kojoley/cease-dependence-on-iterator
Cease dependence on Iterator
2021-06-11 18:20:52 +01:00
e9cde852b3 Merge pull request #132 from ClaymorePT/regex_mutex_fix
Fixes wrong type for mutex in regex v5
2021-06-11 18:12:45 +01:00
d619d934f3 Fix linking with ICU libs when building with clang-cl 2021-06-09 21:45:10 +03:00
da20a5d1dc Add ICU libs search paths even when ICU_ICUUC_NAME, ICU_ICUDT_NAME,
and ICU_ICUIN_NAME are provided by user
2021-06-09 21:37:41 +03:00
d604d1702e Fix ICU libs detection when ICU resources are in
a separate directory
2021-06-09 21:32:40 +03:00
cd30a0560f Prune <iostream> includes 2021-06-07 02:11:41 +03:00
d2a5ddd8a9 Cease dependence on Iterator
It is a fat dependence because it brings Fusion.
2021-06-07 01:47:25 +03:00
dc9c5c50be Don't redefine macros.
Fixes https://github.com/boostorg/regex/issues/127
2021-06-06 09:07:28 +01:00
6064875bff Fixes wrong type for mutex in regex v5
With the Boost.Regex to ehader-only library, the declaration
of a mutex that should have been changed from boost::static_mutex
to std::mutex was left behind. This was preventing regex from
being built for older arm platforms [1]

[1]: https://github.com/openwrt/packages/issues/15725

Signed-off-by: Carlos Miguel Ferreira <carlosmf.pt@gmail.com>
2021-06-03 23:10:37 +01:00
7da62c1edb Merge pull request #125 from mborland/develop
Add missing header
2021-04-11 18:11:52 +01:00
51d2661b76 Add missing header 2021-04-10 18:08:00 +03:00
c0708eaa27 Merge pull request #122 from boostorg/msvc_cxx_20
Fixes and testing update for MSVC in C++20 mode.
2021-03-07 09:38:42 +00:00
92fe5dd4d6 Fixes and testing update for MSVC in C++20 mode. 2021-03-07 08:42:18 +00:00
e74d65810e Remove unneeded cmake code. 2021-01-27 12:34:12 +00:00
cac50784aa Reinstate pending/unicode_iterator.hpp. 2021-01-27 12:32:13 +00:00
8ed04bb6d0 Merge pull request #120 from boostorg/cmake_tests
Cmake tests
2021-01-27 10:57:03 +00:00
7f1b8ff5f1 GHA need to check out the repro! 2021-01-27 10:35:25 +00:00
c330d40739 Correct GHA script. 2021-01-27 10:31:17 +00:00
8a44a1423e Add GHA for CMake tests. 2021-01-27 10:27:47 +00:00
a0de6450c0 Add first cut at CMake tests. 2021-01-27 08:56:59 +00:00
f5f31d7ba9 Simplify CMakeLists.txt now that we're header only.
[CI SKIP]
2021-01-25 16:51:10 +00:00
d0010b022a Merge pull request #116 from boostorg/cxx11
Move forward to C++11 version that can be used standalone.
2021-01-25 13:50:12 +00:00
6e183b7489 Make windows include lean and mean.
Remove Appveyor script for now.
2021-01-25 12:59:07 +00:00
ce47bbe593 Remove more old compiler workarounds. 2021-01-25 11:53:39 +00:00
33c9ed2d42 Document new build changes + standalone mode. 2021-01-25 11:53:07 +00:00
4b4041c04d Add legacy C++03 tests. 2021-01-25 11:52:09 +00:00
15b82d929b GHA: Update dependency scanner. 2021-01-25 09:46:50 +00:00
dad2686566 Add Github actions, remove Travis. 2021-01-25 09:41:50 +00:00
270f41baa9 Merge pull request #118 from eldiener/develop
[skip ci] Add "cxxstd" json field
2021-01-21 10:46:22 +00:00
9508b4d8f3 [skip ci] Add "cxxstd" json field. The "cxxstd" json field is being added to each Boost library's meta json information for libraries in order to specify the minumum C++ standard compilation level. The value of this field matches one of the values for 'cxxstd' in Boost.Build. The purpose of doing this is to provide information for the Boost website documentation for each library which will specify the minimum C++ standard compilation that an end-user must employ in order to use the particular library. This will aid end-users who want to know if they can successfully use a Boost library based on their C++ compiler's compilation level, without having to search the library's documentation to find this out. 2021-01-21 03:22:26 -05:00
443c04d6d4 More cleanups. 2020-12-20 13:13:14 +00:00
95950392f8 Warning suppression. 2020-12-16 14:50:15 +00:00
72d06f0786 Use allocator_traits when appropriate. 2020-12-14 19:56:13 +00:00
b42ec73c4d Add missing file. 2020-12-14 09:04:04 +00:00
bb2346519c Fix some C++14 ism's. 2020-12-13 18:14:50 +00:00
1d980dd796 Fix up detail namespace. 2020-12-13 18:09:09 +00:00
c24967709d Reinstate many workarounds to get older msvc versions compiling. 2020-12-13 18:03:47 +00:00
5e982204f7 Add some missing #includes. 2020-12-11 13:08:38 +00:00
117db379e3 Add missing function bodies to v4 icu code. 2020-12-10 18:33:13 +00:00
f9db491056 More missing files. 2020-12-10 17:04:30 +00:00
38cbd07351 Add missing file 2020-12-10 17:02:20 +00:00
dba05b4d5b Remove more old code and enable standalone mode. 2020-12-10 16:47:08 +00:00
c902bed6a3 Remove more workarounds, start testing standalone mode. 2020-12-04 12:16:36 +00:00
2b157b4170 Remove function call macros from v5 code. 2020-12-03 11:46:20 +00:00
eafb12b9d0 Dead code removal. 2020-12-02 19:07:42 +00:00
2a55aa83bd Big workaround removal. 2020-12-02 19:06:05 +00:00
957dc5b79c Remove a lot of boost dependencies and workarounds. 2020-12-01 18:57:42 +00:00
678b3f5c4d Make regex_raw_buffer header only. 2020-11-30 13:21:49 +00:00
09cce205ed Fix up include macros. 2020-11-30 11:53:44 +00:00
49e8067b80 Make the contents of regex.hpp all inline. 2020-11-29 19:10:05 +00:00
9d64cf60ff Make icu.hpp header only. 2020-11-28 18:28:29 +00:00
c9d389014a Make w32_regex_traits.hpp header only. 2020-11-28 16:51:39 +00:00
5002272ec8 Make w32_regex_traits.hpp header only. 2020-11-28 12:49:59 +00:00
ddb682a208 Make cpp_regex_traits all inline. 2020-11-27 18:13:59 +00:00
27d2853615 Make c_regex_traits all inline.
Fix some C++20 issues.
2020-11-26 20:05:38 +00:00
12b9392391 Remove recursive option for v5. 2020-11-26 17:10:24 +00:00
1bb29f2134 Remove external template instantiation. 2020-11-26 17:00:04 +00:00
72da1fdc29 Preparation for V5. 2020-11-26 16:47:48 +00:00
da23154da4 Fix incorrect references to sub_match having a .last member.
Fixes https://github.com/boostorg/regex/issues/115.
2020-11-23 17:55:09 +00:00
c3ab6405ad Merge branch 'use-boost-override' of https://github.com/EugeneZelenko/regex into develop
Resolved Conflicts:
	include/boost/regex/v4/cpp_regex_traits.hpp
	src/wc_regex_traits.cpp
2020-10-12 19:34:55 +01:00
01f6a67fca Merge pull request #102 from VemundH/bugfix/icu-UnicodeString
Call correct overload in functions with icu UnicodeString argument
2020-10-12 18:28:21 +01:00
77e9223a84 Merge pull request #103 from Romain-Geissler-1A/devel
Fix clang -Wdeprecated-copy warning in basic_regex_creator.hpp
2020-10-12 18:24:31 +01:00
a425ec42ca Merge branch 'develop' of https://github.com/boostorg/regex into develop 2020-10-12 18:23:08 +01:00
a703ab2c59 Fix syntax formatting in docs.
Replaces https://github.com/boostorg/regex/pull/107.
2020-10-12 18:22:57 +01:00
3193bd0877 Merge pull request #113 from giomasce-throwaway/develop
Fix typo in copyright headers.
2020-10-12 18:11:41 +01:00
3ea26dabac Merge pull request #112 from pkl97/regex_typos
Fixed typos (mainly in comments)
2020-10-12 18:10:45 +01:00
21e1ea0877 Fix typo in copyright headers. 2020-10-11 17:22:32 +02:00
9eabbbedcf Fixed typos (mainly in comments) 2020-10-01 16:07:35 +02:00
2639587745 Merge pull request #1 from boostorg/develop
Pull request containing latest changes from upstream
2020-10-01 15:34:23 +02:00
9712546fae Merge pull request #105 from eldiener/develop
Changes for Embarcadero C++ clang-based compilers, targeting Boost 1.74
2020-06-17 19:15:37 +01:00
c9d33026f3 Use BOOST_OVERRIDE to fix GCC -Wsuggest-override and Clang-tidy modernize-use-override warnings.
Also fixed Clang-tidy modernize-redundant-void-arg, readability-container-size-empty, and some readability-simplify-boolean-expr warnings.
Alphabetical order of STL headers.
Fix some misspellings.
2020-05-25 17:04:15 -07:00
f712b89e6f Inline friend function definitions for exported/imported classes must become declarations and inline definitions outside the class for Embarcadero C++ clang-based compilers. This bug has been reported to Embarcadero. 2020-04-25 20:13:16 -04:00
f307ef8353 Turn off testing wide character regexes when not appropriate. 2020-04-19 16:01:21 -04:00
31646aefa7 Always use __cdecl as the calling convention for the Embarcadero C++ clang-based compilers 2020-04-19 15:29:03 -04:00
cc09733d03 Change __BORLANDC__ to BOOST_BORLANDC, which is defined in Boost config for the Embarcadero non-clang-based compilers. 2020-03-31 17:42:38 -04:00
fd710a3bf0 Fix clang -Wdeprecated-copy warning in basic_regex_creator.hpp
/data/mwrep/res/osp/Boost/19-0-0-18/include/boost/regex/v4/basic_regex_creator.hpp:52:4: error: definition of implicit copy assignment operator for 'digraph<char>' is deprecated because it has a user-declared copy constructor [-Werror,-Wdeprecated-copy]
   digraph(const digraph<charT>& d) : std::pair<charT, charT>(d.first, d.second){}
   ^
/data/mwrep/res/osp/Boost/19-0-0-18/include/boost/regex/v4/basic_regex_parser.hpp:1660:17: note: in implicit copy assignment operator for 'boost::re_detail_107000::digraph<char>' first required here
         result = *m_position++;
2020-02-28 02:17:58 +00:00
75b6e20dbd Call correct overload in functions with icu UnicodeString argument 2020-02-27 11:17:34 +01:00
d961318aa2 Merge pull request #101 from boostorg/git_issue_87
Fix recursive expressions where the recursion appears more than once.
2020-01-24 11:19:58 +00:00
afc4229234 Fix recursive expressions where the recursion appears more than once.
Fixes https://github.com/boostorg/regex/issues/87.
Also fix some more msvc warnings.
2020-01-23 19:24:33 +00:00
574fad65f0 Merge pull request #100 from boostorg/git_issue_80
Suppress msvc warnings.
2020-01-22 13:35:04 +00:00
bc160a58f0 Merge branch 'develop' into git_issue_80
Fixed Conflicts:
	include/boost/regex/v4/basic_regex_creator.hpp
	include/boost/regex/v4/basic_regex_parser.hpp
2020-01-21 12:57:09 +00:00
f64c22870f Fix exception specification and msvc warning push/pop. 2020-01-21 10:14:37 +00:00
70c3ffa89a Merge pull request #98 from boostorg/issue_75
Remove limit on the number of backrefs possible.
2020-01-21 10:13:40 +00:00
f80a3ab362 Merge pull request #99 from boostorg/feature/update-cmake
Fix CMake Travis failures
2020-01-21 10:12:56 +00:00
2cd947f7c4 Suppress msvc warnings.
Fixes: https://github.com/boostorg/regex/issues/80
2020-01-20 19:51:46 +00:00
91892ab07d On the xcode6.4 image, git is an older version and doesn't support --jobs 3 2020-01-20 18:51:31 +02:00
bb9c3b68d4 Add -I example to depinst 2020-01-20 16:58:24 +02:00
4788894218 Use --jobs 3 when updating submodules 2020-01-20 16:56:43 +02:00
b0eb5ccb20 Use depinst 2020-01-20 16:48:44 +02:00
a1d0c4fdc4 Update .travis.yml 2020-01-20 16:43:43 +02:00
12fd320f3c Fix CMakeLists.txt 2020-01-20 16:40:28 +02:00
3b98dc901a Change ICU configuration to support cross-compiling.
Fixes: https://github.com/boostorg/regex/issues/78
2020-01-19 18:16:37 +00:00
deb9104ceb Fix gcc warning. 2020-01-19 17:19:54 +00:00
4bb4d392e4 Remove limit on the number of backrefs possible.
Changes named sub-expressions to use different hashing scheme: high order bit is now always set to clashes between hashes and indexes don't happen until 2^30 or 2^62 sub-expressions in 32 and 64 bit code respectively.
Changes bitmask of seen sub-expressions to use dynamic storage for sub-expression indexes above 64.
Adds tests for the above.
Fixes https://github.com/boostorg/regex/issues/75.
2020-01-19 11:28:36 +00:00
b5d60694cc Merge pull request #91 from rdoeffinger/staticptrfix
Avoid generating pointers in writeable data section.
2020-01-07 19:00:52 +00:00
082437d4fd Merge branch 'develop' into staticptrfix 2020-01-07 19:00:38 +00:00
aacd14bf71 Merge pull request #93 from rdoeffinger/makestatic
regex_traits_defaults: Do not export arrays only used in same compila…
2020-01-07 18:56:05 +00:00
a3814a31e9 Merge pull request #92 from rdoeffinger/spellingfix
Minor spelling fix.
2020-01-07 18:54:30 +00:00
6d00984aa9 Merge pull request #79 from stac47/fix_deprecated_copy
Fix gcc -Wdeprecated-copy
2020-01-07 18:54:04 +00:00
edcbf059d7 Merge pull request #90 from Bagira80/patch-1
Point for issues to Github instead of old Trac.
2020-01-07 18:48:36 +00:00
f63c602e6a Merge pull request #86 from Mike-Devel/min_cmake
[CMake] Add minimal cmake support
2020-01-07 18:47:46 +00:00
92f6a803a5 [CMake/CI] Also test build as shared library on travis
Also, as a minor tweak, put cmake builds to the front
as they complete the most quickly
2019-12-28 14:08:58 +01:00
957d2f1bca [CMake] Add some comments about how to use the file 2019-12-28 13:52:21 +01:00
c07e8c4f80 [CMake] Add support for building shared library and restrict absolute include path to build interface 2019-12-28 13:51:31 +01:00
45d12f199d [CMake/CI] Clone additional transitive dependencies 2019-12-28 12:50:47 +01:00
634fa6847e [CMake/CI] Add basic cmake run to travis 2019-12-28 12:50:36 +01:00
7ec82a06d4 [CI] Enable travis script to run with other branches than master or develop 2019-12-28 12:50:36 +01:00
e54e8e0173 [CMake] Disable autolink for regex 2019-12-28 12:50:36 +01:00
bb0c610591 [CMake] Add option for compilation with ICU support 2019-12-08 16:21:39 +01:00
3d44eca405 [CMake] Add option to build some of the examples 2019-12-08 16:11:45 +01:00
e72490638a [CMake] Add minimal cmake file
Generate cmake target that builds the library and which can
be used by other libraries to express their dependency on
this library and retrieve any configuration information
such as the include directory, binary to link to,
transitive dependencies, necessary compiler options or the
required c++ standards level.
2019-12-08 16:11:45 +01:00
3168641320 Avoid generating pointers in writeable data section.
They increase memory consumption and make exploits
easier and are completely unnecessary.
Avoid them by either avoiding the pointer indirection
completely by using char arrays for strings instead
of char pointers, convert "static" pointer variables
to simple local variables, or mark the array of
pointers as const instead of just the things pointed to.
2019-11-08 11:18:43 +01:00
3d72b06e9d regex_traits_defaults: Do not export arrays only used in same compilation unit.
Exporting variables is unreliable on some platforms including Windows,
and it seems can cause compilation errors in some cases.
Also symbols should not be exported unnecessarily purely on principle.
It would even be possible to move the arrays into the function, but
as they are a bit large that seems to be worse for readability.
2019-11-08 11:11:01 +01:00
0baf08108f Minor spelling fix. 2019-11-05 22:25:11 +01:00
a550507517 Update installation instructions for icu.
Regenerate docs.
Fixes: https://github.com/boostorg/regex/issues/89.
2019-10-26 10:51:25 +01:00
fc4dc17dc7 change ICU_LINK configuration 2019-10-25 19:05:52 +01:00
9b6a8e5e82 Point for issues to Github instead of old Trac. 2019-10-08 10:49:01 +02:00
8a8ceab94a Merge pull request #85 from Mike-Devel/develop
Update hash.hpp include path
2019-05-13 18:22:47 +01:00
9db6d59861 Update hash.hpp include path 2019-05-11 19:07:33 +02:00
ac03c4fecc Fix gcc -Wdeprecated-copy 2019-03-01 08:36:15 +00:00
252876ff5a Merge pull request #77 from MarcelRaad/extra_semi
Fix -Wextra-semi clang warnings
2019-02-26 09:19:54 +00:00
a6586678a5 Fix -Wextra-semi clang warnings
Remove superfluous semicola after constructor bodies.
2019-02-25 13:29:16 +01:00
fed22db5f9 Merge pull request #71 from jeking3/cygwin-ci
Add cygwin, cygwin64, and MSVC2017 strict builds to AppVeyor
2019-02-10 13:06:27 +00:00
88f29667b7 Update CI scripts to handle new module layout. 2018-12-20 09:04:02 +00:00
4e0eadc11b Merge branch 'develop' of https://github.com/boostorg/regex into develop 2018-11-11 17:13:22 +00:00
3c6cf87718 Disable external template instances on cygwin - they lead to duplicate symbols for some reason.
See https://github.com/boostorg/regex/issues/64.
2018-11-11 17:12:56 +00:00
cdbffe607b Merge pull request #70 from scramsby/win32-lean-and-mean
Fix potential double-definition of WIN32_LEAN_AND_MEAN macro
2018-11-11 16:52:31 +00:00
23915ade0c Add cygwin, cygwin64, and MSVC2017 strict builds to AppVeyor 2018-11-11 10:39:00 -05:00
f4e1ff192f Fix potential double-definition of WIN32_LEAN_AND_MEAN macro 2018-11-09 16:08:07 -08:00
38afecb48b Add README.md
[CI SKIP]
2018-10-15 18:08:37 +01:00
8a31a996b8 Merge pull request #63 from jeking3/warnings
resolve some warnings
2018-08-25 18:11:20 +01:00
40ecdc3f8b Disable template instantiation for Clang: it breaks with -fvisibility=hidden 2018-08-25 18:05:18 +01:00
c7520556f7 Merge pull request #65 from boostorg/git_issue61
Tentative fix for msvc warnings.
2018-07-24 18:44:30 +01:00
f5b7d3a4f9 Correct apple clang version check. 2018-07-23 19:10:47 +01:00
6369c3c5ee Merge pull request #51 from freiling/develop
Move BOOST_REGEX_DETAIL_NS::RegExData::type_pf cases out of BOOST_REG…
2018-07-22 19:04:52 +01:00
5177518fe3 Fix missing \n at end of file,
Fix some clang warnings.
Add gcc 7&8 to CI tests.
2018-07-22 18:25:35 +01:00
7b2ccc0095 Tentative fix for msvc warnings.
See https://github.com/boostorg/regex/issues/61.
Adds warning test case.
2018-07-22 17:16:21 +01:00
2517588955 Fix \R when no_escapes_in_list flag is set.
Fixes: https://github.com/boostorg/regex/issues/57
2018-07-22 11:26:33 +01:00
231dbc3ebf Correct behaviour of \b when matching null-strings.
See https://github.com/boostorg/regex/issues/40
2018-07-21 15:19:41 +01:00
39f1cc0238 resolve some warnings 2018-07-20 18:29:11 +00:00
867cc5f0fc Stop using BOOST_WORKAROUND in a header which may be included in C code. 2018-07-18 18:57:07 +01:00
ac49efa23f Apply changes from https://github.com/boostorg/regex/pull/16 2018-07-18 18:30:14 +01:00
35fbb2e5e2 Disable some std::locale tests with VC15.7 as they (incorrectly) assert in the C runtime. 2018-07-17 19:36:03 +01:00
5d990fd751 Merge pull request #58 from pkl97/develop
Fixed typo in exception text
2018-05-06 11:44:45 +01:00
80a2a12b7a Fixed typo in exception text 2018-02-11 20:35:50 +01:00
e39a99c6f5 Update CI dependency list 2018-01-05 12:59:30 +00:00
fa8b79bca9 Regex.Defuzz, fix for https://bugs.chromium.org/p/oss-fuzz/issues/detail?id=4615 2018-01-04 18:51:21 +00:00
b13fb44ac5 Regex.Defuzzing: Fix for https://bugs.chromium.org/p/oss-fuzz/issues/detail?id=4659&q=jz.maddock&colspec=ID%20Type%20Component%20Status%20Proj%20Reported%20Owner%20Summary 2018-01-03 18:32:45 +00:00
3043906da2 Regex.ICU: use BOOST_REGEX_UCHAR_IS_WCHAR_T in a few other places, and improve concept checks. 2017-12-24 18:39:54 +00:00
5e11600dfa Merge pull request #55 from boostorg/pr/fix-uchar
Define BOOST_REGEX_UCHAR_IS_WCHAR_T, use it to disable overloads
2017-12-24 16:59:46 +00:00
799b09dc26 Define BOOST_REGEX_UCHAR_IS_WCHAR_T, use it to disable overloads 2017-12-24 01:49:32 +02:00
fe9d2a2d66 Merge pull request #54 from DanielaE/fix/no-iterator-inheritance
Inheritance from std::iterator is deprecated in c++17. Therefore repl…
2017-12-23 19:35:28 +00:00
59d501b07b Regex: fix integer shift warning/error in icu.cpp 2017-12-23 19:18:08 +00:00
d5bf5966e2 Merge pull request #53 from DanielaE/fix/replace-deprecated-allocator-members
replace members of std::allocate which are deprecated in c++17 by the…
2017-12-23 19:11:18 +00:00
912ba92bae Merge pull request #52 from rummt/patch-1
typo in error message 'openening' should be 'opening'
2017-12-23 19:03:15 +00:00
cc5a4e85ae Inheriting std::iterator is deprecated in c++17.
Therefore replace the inheritance by lifting std::iterator's members into the derived class. Fortunately, this is already done in Boost.Regex so that dropping the inheritance is a no-brainer.

Signed-off-by: Daniela Engert <dani@ngrt.de>
2017-12-22 15:59:49 +01:00
e6ce5523c6 replace members of std::allocate which are deprecated in c++17 by their cousins from std::allocator_traits.
Signed-off-by: Daniela Engert <dani@ngrt.de>
2017-12-21 17:48:23 +01:00
c60ee3189d Merge branch 'develop' of https://github.com/boostorg/regex into develop 2017-12-16 09:26:46 +00:00
e62d8b5332 Regex.C++17: Fix iterator usage. 2017-12-16 09:26:33 +00:00
a3f1cf9dfc typo in error message 'openening' should be 'opening' 2017-12-12 11:07:59 +00:00
b41d9dc323 Move BOOST_REGEX_DETAIL_NS::RegExData::type_pf cases out of BOOST_REGEX_NO_FILEITER to avoid compiler warnings about missing cases in case statement 2017-12-08 17:07:51 -08:00
47be67134a Fix -Wshadow warnings in quick.cpp 2017-12-03 00:36:11 +02:00
00e802c671 Add quick test target (for CI) 2017-12-02 18:24:00 +02:00
2608372174 Regex: Fix travis.yml usage of cxxstd=. 2017-11-10 08:08:27 +00:00
1480e33dc6 Regex: Fix recursive algorithm builds. 2017-11-09 18:13:16 +00:00
e94f079215 Regex: fix locale specific tests so they do all pass now! 2017-11-09 11:31:48 +00:00
6246f5ec51 Regex: Set a limit on how many recursions we allow. 2017-11-09 11:23:54 +00:00
9f104b0664 Regex: Streamline travis builds further. 2017-11-02 11:16:02 +00:00
0c938cd9ff Regex: Apply fix for clang on Windows, see: https://github.com/boostorg/regex/issues/44 2017-10-26 18:05:36 +01:00
f949e55e9c Regex: Add better tests for skipping of comments in expressions. 2017-10-26 18:04:41 +01:00
3693a5de10 Regex: previous fix could go into infinite loop when a comment was followed by a "(", fix that. 2017-10-26 13:05:33 +01:00
50386af870 Regex: Reduce Travis testing load. 2017-10-24 19:14:58 +01:00
f251a98662 Regex: When matching an (*ACCEPT) and skipping forwards, we have to be careful not to stop skipping prematurely if we're inside a lookahead.
Fixes: https://bugs.chromium.org/p/oss-fuzz/issues/detail?id=3493#c2
2017-10-24 19:06:53 +01:00
50453e319a Regex: Repeating a repeat is not allowed, even if there is a comment block in between the two.
Fixes: https://bugs.chromium.org/p/oss-fuzz/issues/detail?id=3479#c2
2017-10-24 17:56:02 +01:00
544e20a339 Regex: Backup and restore internal match_results when saving recursion backtracking info, as well as the state required to restore the recursion stack. Fixes: https://bugs.chromium.org/p/oss-fuzz/issues/detail?id=3478#c1 2017-10-23 18:49:08 +01:00
7de023237f Regex: Add a hard limit on the number of nested parenthesis allowed.
Fixes https://bugs.chromium.org/p/oss-fuzz/issues/detail?id=3471#c2.
2017-10-19 18:23:43 +01:00
b59dc980c8 Remove deprecated files and update docs. 2017-10-09 18:31:42 +01:00
f343cab680 Regex: Fix handling of repeats when mod_x is in effect.
See https://oss-fuzz.com/v2/testcase-detail/6420486177161216?noredirect=1
2017-10-08 11:52:54 +01:00
dc74e145d9 Try and fix travis CI configuration issue. 2017-10-07 17:24:34 +01:00
f592693c9b Regex: Fix potential negation of INT_MIN,
see https://oss-fuzz.com/v2/testcase-detail/6646578892767232?noredirect=1.
2017-10-07 17:23:59 +01:00
881a157243 Regex: Fix integer overflow in expression parsing.
See: https://oss-fuzz.com/v2/testcase-detail/6189682419302400?noredirect=1
2017-10-07 09:47:19 +01:00
289ce86488 Regex: move boost headers to top of list to work around clang issue which requires workarounds present in config.hpp. 2017-09-21 17:15:51 +01:00
09894a5e21 Fix escapes in test case. 2017-08-04 09:08:12 +01:00
a32e0cc9d3 Fix pattern escaping in regex used for \R so it works when the x-modifier is in effect.
Fixes: https://svn.boost.org/trac10/ticket/12960
2017-08-03 18:04:41 +01:00
5c543a8e2b Copy named sub-expression info when adapting ICU via iterators.
Fixes: https://svn.boost.org/trac10/ticket/13126.
2017-08-01 19:43:44 +01:00
9d4a4b7e62 Merge pull request #38 from boostorg/issue13001
Shorter path names in docs.
2017-08-01 18:03:41 +01:00
4828a7f94d Regenerate documentation with shorter path names.
Fixes: https://svn.boost.org/trac10/ticket/13001
2017-08-01 18:01:46 +01:00
d96012b04d Update linux performance results 2017-08-01 13:16:26 +01:00
9cfc6a4e30 Change performance doc generator to shorten path names.
Make sure all sections have names.
See #13001.
2017-08-01 08:18:05 +01:00
bc9b25b5d3 Fix potential overflow in max_state_count calculation.
Fixes: https://svn.boost.org/trac10/ticket/13036.
2017-07-31 19:18:10 +01:00
d97bcfb5dd Fix integer types and signedness:
Fixes https://svn.boost.org/trac10/ticket/13034
2017-07-31 18:51:25 +01:00
ab399c9159 Documentation fix for backreferences example. Fixes issue #33. 2017-07-30 18:51:10 +01:00
a59890f520 Merge branch 'develop' of https://github.com/boostorg/regex into develop 2017-06-04 08:06:35 +01:00
4ac4a451df CI: Fix bjam arguments on appveyor. 2017-06-04 08:06:20 +01:00
18e38c2172 Merge pull request #30 from DanielaE/feature/replace-deprecated-c++98-binder
Conditionally replace deprecated/removed C++98 std::bind1st by std::b…
2017-06-02 08:18:24 +01:00
df563a8858 Merge pull request #31 from VemundH/patch-1
Conditionally replace deprecated/removed C++98 std::bind2nd by std::bind
2017-06-02 08:18:15 +01:00
65fdfa526a Merge pull request #29 from danieljames/feature/fix-escape
Escape back slashes
2017-06-02 08:17:07 +01:00
0f5d7ddabd Merge pull request #28 from Lastique/patch-1
Silence MSVC 14.1 warnings of narrowing conversion
2017-06-02 08:16:10 +01:00
af55bf7b1f CI: Add more dependencies to appveyor file. 2017-05-31 15:00:37 +01:00
dba63e41a8 CI: Add one more missing dependency. 2017-05-31 14:59:40 +01:00
7fa0ddd841 CI: Add one more missing dependency. 2017-05-31 13:24:43 +01:00
cc09911d6d CI: Add missing dependency 2017-05-31 08:49:27 +01:00
1dad9252db CI: Manually specify dependencies, and streamline number of Appveyor tests. 2017-05-30 19:06:05 +01:00
2c98bafda8 CI: Fix program_options dependency spelling. 2017-05-30 15:03:40 +01:00
180c0e7e91 CI: Manually fix up missing dependency to program_options. 2017-05-30 13:27:31 +01:00
35fa1626d5 Add CI testing. 2017-05-30 09:47:07 +01:00
47635d0733 Update icu.cpp
Conditionally replace deprecated/removed C++98 std::bind2nd by std::bind
2017-05-22 15:39:45 +02:00
b9cad50387 Conditionally replace deprecated/removed C++98 std::bind1st by std::bind.
Signed-off-by: Daniela Engert <dani@ngrt.de>
2017-05-14 16:20:21 +02:00
791c447922 Escape back slashes
Fixes Trac #12096.

https://svn.boost.org/trac/boost/ticket/12096
2017-04-09 13:20:03 +01:00
f89c75f7b0 Silence MSVC 14.1 warnings of narrowing conversion
In debug mode the compiler is not able to see that the int constant can fit in the character type without loss.
2017-03-25 20:34:56 +03:00
22aedd996c Fix iterator comparisons so legacy compilers (sun and VC6) can handle them 2017-03-01 11:33:28 +00:00
5456180bb3 Update docs for latest fixed issues. 2017-02-24 13:14:48 +00:00
b1a97fcb95 Merge branch 'de_fuzz' into develop 2017-02-24 13:09:33 +00:00
1acbd42eb8 de-fuzz: fix 2 more gcc warnings 2017-02-24 11:48:27 +00:00
ff8ed9124d Fix broken links in docs. 2017-02-23 10:40:45 +00:00
93926479e3 de-fuzz: suppress a couple of warnings introduced by de-fuzzing fixes. 2017-02-22 18:46:34 +00:00
e7aec5355c de-fuzz: Add Jamfile 2017-02-22 18:26:59 +00:00
3000f19274 Add wide character test case and corpus 2017-02-22 17:02:34 +00:00
c8044ffca0 de-fuzz: more recursive calls that require proper stack unwinding to prevent memory leaks if matching throws. 2017-02-23 09:43:22 +00:00
982f3bbe45 de-fuzz: need to fail when a named recursive subexpression refers to an invalid name. 2017-02-23 09:30:49 +00:00
555bedc97d de-fuzz: add new corpus files 2017-02-22 13:11:01 +00:00
2e7e73aecf de-fuzz: Prevent excessive left shifts 2017-02-22 12:52:53 +00:00
3d2dc325de de-fuzz: Remove debugging code. 2017-02-22 12:45:48 +00:00
85cd85013d de-fuzz: Memory leak fix: Need to unwind stack when doing recursive call on non-recursive algorithm 2017-02-22 12:43:28 +00:00
b65bf1b459 de-fuzz: make sure recursion stack always has a valid start location for the recursion. 2017-02-21 19:38:36 +00:00
b0a83dc8d9 de-fuzz: fix overflow in shift 2017-02-21 11:04:26 +00:00
ac3838b622 de-fuzz: fix undefined behaviour in negating enum type 2017-02-21 10:53:53 +00:00
d1789c75da de-fuzz: generate first corpus files. 2017-02-21 18:00:08 +00:00
f301f3a412 de-fuzz: previous fix broke some code, re-fix it. 2017-02-21 12:43:08 +00:00
559f24d6d0 Add first de-fuzzer files 2017-02-20 14:55:55 +00:00
94cd9e582b Simplify adding items to lists, and fix Jamfile build failure. 2017-02-20 13:44:24 +00:00
ae9f38e178 de-fuzz: Failed Pearl verbs should fail better and louder. 2017-02-18 13:04:34 +00:00
d70b7bcefe de-fuzz: fix infinite recursion when analysing tail-recursive expressions. 2017-02-16 19:24:22 +00:00
7f89a8f3b8 de-fuzz: add missing typename qualifiers to previous fix. 2017-02-15 19:48:56 +00:00
edd94320c7 de-fuzz: prevent infinite recursion in recursive expressions (case 14). 2017-02-15 19:44:41 +00:00
b05fafe1c5 de-fuzz: improve set creation so as not to allow duplicate characters. 2017-02-14 19:41:35 +00:00
febd44ddd6 de-fuzz, first fix for issue 14.
Make zeros in character set a single character long only.
2017-02-14 18:13:32 +00:00
2cb49b97da de-fuzz: Fix case 0 again. 2017-02-14 17:38:47 +00:00
8337584087 De-Fuzz: Fixes for issues 0 and 3 from #12818:
Prevent left shifting by more bits than there are in type unsigned, and
Check that alternative points to a valid state before accessing it: we may not have constructed that state yet in a fail situation.
2017-02-12 19:57:35 +00:00
7b9b5ee181 Add note about ] being a special character in some situations. 2017-02-12 19:54:44 +00:00
e215c603ad Use the same calling convention for all msvc clones. 2017-02-09 18:24:21 +00:00
4bfdae4a9f Change config so all msvc compatible compilers use the same algorithm.
This *might* make msvc builds binary compatible with Intel or Clang clients.
See https://svn.boost.org/trac/boost/ticket/12233.
2017-02-08 19:20:04 +00:00
1e1c400edc Merge branch 'develop' of https://github.com/boostorg/regex into develop 2017-02-07 19:57:54 +00:00
fa2c76c0de Sun toolset no longer needs link=static on tests. 2017-02-07 19:57:42 +00:00
28ec48fde1 Merge pull request #26 from akumta/patch-1
Per boost ticket 12490
2017-02-07 19:55:39 +00:00
8b477724a7 Add missing "import testing;" to Jamfile.v2. 2016-11-10 10:51:41 +00:00
84516a9fa1 Add, and update, documentation build targets. 2016-10-07 23:07:36 -05:00
39663a57fa Per boost ticket 12490 2016-09-28 09:33:11 -07:00
b3bcdfd669 Merge pull request #25 from Kojoley/fix-missing-noreturn
Fixed missing noreturn
2016-09-04 17:16:45 +01:00
d92e940ade Fixed missing noreturn 2016-09-01 19:55:40 +03:00
90412e733d Update history. 2016-08-22 12:50:15 +01:00
0f128c2a89 Fix missing variable name in concept checks. 2016-08-07 18:33:59 +01:00
d1b3e9f36d Merge branch 'develop' of https://github.com/boostorg/regex into develop 2016-08-01 12:24:22 +00:00
cc21bf9283 Fix Oracle C++ concept failures 2016-08-01 12:24:00 +00:00
7184e3b021 Merge branch 'develop' of https://github.com/boostorg/regex into develop 2016-07-31 18:44:55 +01:00
52169ab43f Fix missing include. 2016-07-31 18:44:33 +01:00
ddd808f761 Fix ICU configuration to use static library only when using a static runtime 2016-07-20 18:20:37 +00:00
a824b7d236 Fix copying of extra match data when using ICU.
See: https://svn.boost.org/trac/boost/ticket/12130
2016-06-12 13:09:12 +01:00
acade9f20c Allow use of ICU with static runtime.
See: https://svn.boost.org/trac/boost/ticket/12011
2016-06-11 18:46:23 +01:00
1101c0be6a Update library history. 2016-06-10 17:59:12 +01:00
7719dedbaf Fix buffer over-run error when parsing invalid regex.
See: https://svn.boost.org/trac/boost/ticket/12222.
2016-06-09 19:00:29 +01:00
e3228b61eb Fix ICU detection.
See: https://svn.boost.org/trac/boost/ticket/12152.
2016-06-09 18:02:31 +01:00
9059bfb5c6 Fix case-sensitivity change behaviour.
See https://svn.boost.org/trac/boost/ticket/11205.
Update docs to match.
2016-03-14 19:22:18 +00:00
a9760859b0 Merge branch 'develop' of https://github.com/boostorg/regex into develop 2016-03-12 19:01:33 +00:00
d1e65490e0 Update docs in response to https://svn.boost.org/trac/boost/ticket/11776 2016-03-12 19:01:17 +00:00
2db644f83e Merge pull request #24 from MarcelRaad/patch-1
Fix test on compilers without char32_t
2016-03-12 16:54:52 +00:00
3ea03e364c Fix test on compilers without char32_t
As the include for BOOST_NO_CXX11_CHAR32_T was missing, the test didn't compile.
2016-03-11 17:23:53 +01:00
e217808156 Fix declaration order in test case 2016-02-17 19:57:49 +00:00
36b2fab227 Add file missed in previous commit. 2016-02-17 19:24:19 +00:00
955d077d2b Allow types wider than int in \x{} expressions (for char32_t etc).
Fixes: https://svn.boost.org/trac/boost/ticket/11988.
2016-02-17 18:58:05 +00:00
05dc9f4a44 Update docs. 2016-01-10 18:44:51 +00:00
d8af53e222 restored missing header 2015-12-31 15:48:01 -08:00
a0dfd81516 Lockfree mem_block_cache only active if std::atomic is available 2015-12-31 15:46:20 -08:00
3f14031142 Updated with platform checks 2015-12-15 14:26:03 -08:00
b9f55efe98 Made the mem_cache_block lockfree
This *significantly* improves parallel performance of regex.
Currently if I have a large number of threads all using regexes; even if
they are using idependent regex objects, performance is still extremely poor
due to the lock inside of the mem_block_cache.
2015-12-08 21:17:50 -08:00
eb729f6557 Disable all Win32 API usage on Windows runtime for now, but see also: https://github.com/boostorg/regex/pull/22 for a possible more compete solution. 2015-11-07 09:13:35 +00:00
aa6495ae48 Merge pull request #21 from ya1gaurav/patch-4
avoid duplicate check of markid.
2015-11-03 17:59:32 +00:00
2a525e5aa6 avoid duplicate check of markid.
Markid is already checked to be >0.
2015-11-03 14:12:17 +05:30
e824ddb35b Remove redundant check and make it an assert. 2015-10-23 13:27:01 +01:00
526d9d4c2e Merge branch 'patch-3' of https://github.com/ya1gaurav/regex into develop 2015-10-23 13:22:07 +01:00
6b36c9a7c6 Fix valgrind detected issues 2015-10-23 13:07:04 +01:00
7cbef4a79b Add missing include. 2015-10-22 18:03:03 +01:00
afca81cd76 disambiguate "extended" 2015-10-22 18:02:43 +01:00
b4541fa88e Qualify some ambiguous names. 2015-10-22 13:33:25 +01:00
e5986b8f76 Tentative VC7.1 workaround. 2015-10-22 11:29:55 +01:00
5fa0354cd8 Check return value of sprintf again.
At other places return value of sprintf is checked, but missed here.
2015-10-20 14:54:48 +05:30
0bc8abb04c Fix ICU error code usage. 2015-10-18 18:38:29 +01:00
1787274280 Comment new tests. 2015-10-18 18:18:37 +01:00
0abd5557c0 Add missing #includes. 2015-10-18 18:13:27 +01:00
39fda8e55b Make sure std lib is invoked to catch shared lib miss-match. 2015-10-18 18:11:49 +01:00
6e80ff8c4c Fix rule name. 2015-10-18 17:52:59 +01:00
389b9c35e0 Try and improve ICU detection to avoid "DLL Hell". 2015-10-18 17:50:40 +01:00
d4367c9aad Fix #include spelling 2015-10-16 17:05:33 +01:00
0d5359b928 Add missing #include. 2015-10-16 17:04:25 +01:00
8a48983900 Add readme. 2015-10-15 18:29:48 +01:00
e8b2d0cac4 Regenerate docs with Linux results. 2015-10-15 18:26:19 +01:00
53f3edd652 Fix Linux compile failures, and run tests on Ubuntu. 2015-10-15 18:24:15 +01:00
76ce33da74 Change docs to use new performance test code,
upgrade docs to quickbook 1.7.
2015-10-15 13:27:45 +01:00
3939d1a1a4 change detail/ to core/ 2015-10-08 10:47:35 +01:00
59cc22d75f Merge pull request #18 from mauve/universal-windows
Universal windows
2015-10-08 10:31:53 +01:00
09e789b4c6 Remove all uses of Boost.Test. 2015-10-08 10:06:34 +01:00
6d2be646d8 universal-windows: Do not build w32_regex_traits
Since Vista LCID has been deprecated and locales are now using string-names,
this makes the effort to support w32_regex_traits quite large, therefore we
opt to disable w32_regex_traits right now when targeting universal-windows.
2015-10-08 10:22:44 +02:00
541bcde27f universal-windows: Disable deprecated fileiter 2015-10-08 10:05:20 +02:00
c1d2d1a736 universal-windows: Use C++ locale 2015-10-08 10:05:19 +02:00
ffac6a2035 universal-windows: Do not define BOOST_REGEX_HAS_OTHER_WCHAR_T
Just as on VC10 this causes linker errors with std::collate<unsigned short>::id.
2015-10-08 09:37:16 +02:00
3b461992b4 regex: Add dependency on boost.predef 2015-10-08 09:36:26 +02:00
a307fd7077 Fix msvc warning. 2015-10-06 13:17:01 +01:00
f617c73e9a Fix some GCC and clang warnings introduced by the new code 2015-10-06 12:46:09 +01:00
2a5a5f3825 Document changes. 2015-10-05 19:13:04 +01:00
201d3a424e Add recursive implementation of THEN. 2015-10-05 18:27:37 +01:00
7a4e883675 Get THEN working for non-recursive implementation.
Fix various bugs in the other verbs exposed by new tests.
2015-10-04 19:28:25 +01:00
9a36e035f2 Add support for PRUNE and SKIP (no MARK's though). 2015-10-01 18:34:59 +01:00
83140ddbed Fix up recursive implementation of ACCEPT and COMMIT. 2015-09-30 18:47:59 +01:00
b208ef4eed Get commit working in recursive mode. 2015-09-29 19:20:09 +01:00
c281c9cc40 Add COMMIT support plus lots of tests. 2015-09-29 17:40:43 +01:00
2580fb035f Add support for ACCEPT verb. 2015-09-26 18:47:39 +01:00
b557febb0e Start adding Perl verb support with FAIL as the first supported verb. 2015-09-25 19:30:20 +01:00
d8c95a9950 Change POSIX API's so regcomp doesn't check for magic value and read potentially uninitialized memory.
See https://svn.boost.org/trac/boost/ticket/11472.
2015-09-25 12:41:02 +01:00
94c7d4a38a Fix start of extended character range.
See https://svn.boost.org/trac/boost/ticket/11524
2015-09-24 19:01:44 +01:00
5e98fe9a6a Shared library doesn't work with Oracle compiler. 2015-08-19 18:20:20 +01:00
b9ee7a2f2e Oracle compiler in C++11 mode doesn't like external template instances in shared library. 2015-08-17 19:28:21 +01:00
5da9b940a5 Fix indentation issue, see https://github.com/boostorg/regex/pull/13 2015-05-05 13:05:09 +01:00
6ffcc5ede0 Change detail namespace.
Big search and replace to change name of internal namepace so it's mangled with the Boost version number - the aim is to reduce the chances of mixing different header and library versions.
2015-04-04 19:10:37 +01:00
297e87360c Fix for bug in recursive expressions, see http://lists.boost.org/Archives/boost/2015/03/221018.php 2015-03-24 19:09:17 +00:00
74d6318135 Add missing function bodies for sub_match::begin/end and enhance tests. 2015-03-19 19:50:00 +00:00
eaeb38c7e9 Remove use of register keyword as it's deprecated in C++11. 2015-03-19 19:07:00 +00:00
668279010d Add workaround for broken Cygwin ctype facet, plus some warning suppression. 2015-03-19 19:06:26 +00:00
3fde6e8ddd Make sub_match a valid range as per https://svn.boost.org/trac/boost/ticket/11036 2015-03-19 18:14:41 +00:00
753b72de0a Merge branch 'develop' 2015-02-14 13:22:25 +00:00
3c8ecc2b35 Update history. 2015-02-14 13:21:37 +00:00
d4506c48ac Merge branch 'develop' 2015-02-14 12:56:15 +00:00
a87ecdc49c Merge branch 'develop' of https://github.com/boostorg/regex into develop 2015-02-13 19:24:19 +00:00
13f707b381 Latest ICU doesn't permit the delayload option :( 2015-02-13 19:24:05 +00:00
6a0a22f174 Merge pull request #10 from jhunold/variant
Only specify debug library name for msvc and intel
2015-02-13 19:22:03 +00:00
8921188b70 Only specify debug library name for msvc and intel
Boost.Build can then fallback to the release libraries for these
compilers for user-defined variants.
2015-02-09 12:09:56 +01:00
39aa10d82d Fix for: https://github.com/boostorg/regex/pull/9 2014-12-31 19:31:20 +00:00
f6a9bce728 Fix icu behaviour with partial matches. See https://svn.boost.org/trac/boost/ticket/10114 2014-12-02 09:31:42 +00:00
115c4e7f42 Fix typo, see https://svn.boost.org/trac/boost/ticket/10268 2014-11-13 11:23:12 +00:00
dbda6314da Initialize all members in initializer list, see https://github.com/boostorg/regex/pull/6 2014-11-13 11:02:36 +00:00
ddd48205b8 Silence Covertity warnings, see https://github.com/boostorg/regex/pull/7 2014-11-13 11:01:50 +00:00
e930d21bd2 Merge branch 'patch-3' of https://github.com/tempoz/regex into develop 2014-11-13 10:17:11 +00:00
abf57b082b Initialize m_position, m_end, and m_flags
The constructor for basic_regex_formatter left m_position, m_end, and m_flags uninitialized, as uncovered by Coverity CID12310. We now value-initialize them in the initializer list.
2014-11-11 13:57:37 -05:00
406b2a9aa1 Apply patch from https://svn.boost.org/trac/boost/ticket/10682 2014-10-21 09:15:40 +01:00
741e684ac3 Merge branch 'develop' 2014-10-18 16:54:49 +01:00
a50c438d77 Document {} behaving as literals in some contexts.
Regen docs.
2014-09-25 11:54:14 +01:00
21d73e9851 Merge branch 'develop' of https://github.com/boostorg/regex into develop 2014-09-25 11:45:51 +01:00
05b582761d Fix case that differs from Perl behavior. 2014-09-25 11:45:26 +01:00
d96023f45d Merge pull request #5 from danieljames/metadata
Create metadata file.
2014-08-18 17:37:03 +01:00
55841a73fc Add metadata file. 2014-08-18 15:10:09 +01:00
b61c07c264 Merge branch 'develop' 2014-06-29 18:09:24 +01:00
7bdb2122d4 Remove dead file. 2014-06-29 17:47:30 +01:00
34e1a6e0a0 Merge branch 'develop' 2014-06-18 17:46:06 +01:00
d90fa5bb92 Merge branch 'fix/9544' of https://github.com/pabigot/boost-regex into develop 2014-06-18 17:20:18 +01:00
a1771b6465 Merge branch 'develop' 2014-05-23 13:17:38 +01:00
4da55ec468 Doc update. 2014-05-23 13:16:30 +01:00
778b7881ca Merge branch 'develop' of https://github.com/boostorg/regex into develop 2014-04-24 11:36:22 +01:00
7a9887f7eb Remove use of deprecated register keyword, see: https://svn.boost.org/trac/boost/ticket/9640 2014-04-24 11:35:58 +01:00
0d2807279d Merge pull request #3 from Lastique/patch-1
Remove register storage specifier
2014-03-23 16:40:12 +00:00
9c00e47bac Remove register storage specifier
Remove register storage specifier to silence clang warnings "'register' storage class specifier is deprecated".
2014-03-23 15:23:20 +03:00
cd0e501062 Merge branch 'develop' 2014-02-08 16:21:53 +00:00
88107e2c7b Revised tentative fix for VC11/12 failures which occur when calling wcsxfrm for "\0". 2014-01-22 19:00:40 +00:00
8ee162b2af Merge branch 'develop' of https://github.com/boostorg/regex into develop 2014-01-22 13:47:14 +00:00
330a033177 Tentative fix for case where a transformation of a NULL string is requested. 2014-01-22 13:46:38 +00:00
1b8322ecbf fix trac 9544: gcc 4.9.0 -std=c++1y breakage
This is GCC bug PR C++/59681 but the Boost fix is trivial and the GCC
one is (probably) not.

See: http://gcc.gnu.org/bugzilla/show_bug.cgi?id=59681
2014-01-04 22:03:10 -06:00
dc63209905 Fix no-exception handling build with GCC. 2013-12-20 11:44:50 +00:00
f1aa75af2c Add checks for invalid UTF-8 sequences, see: https://svn.boost.org/trac/boost/ticket/9473 2013-12-19 10:48:06 +00:00
0983ff065e Fix generic mutex usage, see https://svn.boost.org/trac/boost/ticket/9461. 2013-12-18 18:15:41 +00:00
b9b3966fd2 Update history and version number, regenerate docs. 2013-12-18 17:25:26 +00:00
d9cb36d0d3 Fix GCC test compiles with exception handling disabled. 2013-12-18 17:06:08 +00:00
6230db51b1 Fix for std::locale's which produce collate keys with embedded null's, see https://svn.boost.org/trac/boost/ticket/9451 2013-12-18 16:54:36 +00:00
937cd366c5 BREAKING CHANGE: change mark_count to do what's documented (and what the std does).
See https://svn.boost.org/trac/boost/ticket/9227.
2013-12-14 17:43:24 +00:00
e5bbcac3da Fix typos from https://svn.boost.org/trac/boost/ticket/9283 and update history. 2013-12-14 17:42:13 +00:00
7c7f38b009 Add better error checks in mutex support, see https://svn.boost.org/trac/boost/ticket/8903 2013-12-14 12:58:38 +00:00
a3075dd98f Merge branch 'develop' 2013-12-07 13:31:35 +00:00
34aa2ad2f5 merged develop->master to get first git merge point 2013-12-07 13:01:42 +00:00
956d3c4bcf Simplify multi-component ifdefs containing BOOST_NO_TEMPLATE_PARTIAL_SPECIALIZATION
[SVN r86248]
2013-10-11 23:20:59 +00:00
2d8ee203bf Regex: Remove obsolete GCC version checks.
[SVN r86065]
2013-09-30 15:57:49 +00:00
49b7f2c8f9 Regex: Remove obsolete MSVC version check.
[SVN r86020]
2013-09-30 00:17:24 +00:00
70cd773533 Regex: Remove obsolete MSVC version checks.
[SVN r85921]
2013-09-25 21:16:24 +00:00
7158ab5734 Regex: Remove use of obsolete macro for template types and args.
[SVN r85914]
2013-09-25 21:13:11 +00:00
9fccd1ca89 Regex: Remove ATL specific define for old MSVC.
[SVN r85913]
2013-09-25 21:12:55 +00:00
d6b0b18650 Remove use of obsolete BOOST_APPEND_EXPLICIT_TEMPLATE_TYPE{,_SPEC} macro.
[SVN r85896]
2013-09-25 10:29:44 +00:00
b36d432ffa Merge minor fixes from Trunk.
[SVN r85727]
2013-09-17 17:42:00 +00:00
82e0fc2222 Optimise iterator advances for slow (non-random access) iterators.
[SVN r84999]
2013-07-10 16:10:44 +00:00
b738a55e0d Merge regex bug fix.
Refs #8569.

[SVN r84463]
2013-05-24 17:09:40 +00:00
4d596d33f4 Document bug fix. Regenerate docs.
Refs #8569.

[SVN r84460]
2013-05-24 12:07:30 +00:00
66d8b8140a When a {} repeat sequence is invalid or incomplete, and the language is Perl, then backtrack and treat the sequence as a literal, not a repeat operator.
Fixes #8569.

[SVN r84371]
2013-05-19 11:12:14 +00:00
8a16bff57a Apply updated patches from #8476.
Fixes #8476.

[SVN r84052]
2013-04-26 10:33:22 +00:00
eed2a486c4 Apply patch from #8476.
Fixes #8476.

[SVN r84015]
2013-04-22 17:29:50 +00:00
3162e5ef22 Fix formatting of document.
Fixes #8159.

[SVN r83987]
2013-04-20 16:02:34 +00:00
55daec294e Fix misc. GCC-4.8 warnings. Refs #8184
[SVN r83980]
2013-04-20 12:14:36 +00:00
cc040b0dd5 Fix buffer size determination.
Fixes #8082.

[SVN r83967]
2013-04-19 17:45:22 +00:00
f6870ad64a Merge minor fixes from Trunk.
[SVN r83498]
2013-03-19 18:48:24 +00:00
06463bec85 Warning suppression.
Fixes #8036.

[SVN r82831]
2013-02-12 17:05:01 +00:00
fded895002 Fix bug in partial matches and POSIX or literal expressions.
[SVN r82673]
2013-01-31 18:31:25 +00:00
722c6b81e6 Fix quickbook markup.
Fixes #7958.

[SVN r82672]
2013-01-31 17:49:21 +00:00
1f24ceed4c Add some casts to suppress GCC warnings.
[SVN r82662]
2013-01-28 19:19:56 +00:00
e70d3b6b4e Merge fixes from Trunk.
[SVN r81819]
2012-12-10 13:18:45 +00:00
4162776575 Add missing optimization for leading .* repeats.
Fixes #7758.

[SVN r81705]
2012-12-04 16:51:18 +00:00
333bdbaf14 Update makesfiles.
Deprecate makefiles and update docs.
Fixes #7286.

[SVN r81621]
2012-11-29 10:46:51 +00:00
e2632f2f2f Suppress GCC warning and update History log.
Regenerate docs.
Fixes #7644.

[SVN r81620]
2012-11-29 10:28:07 +00:00
bc8cd9e148 Add further error checking to UTF-8 decoding.
Fixes #7744.

[SVN r81614]
2012-11-28 17:57:26 +00:00
82610247fc Removed missed usage of deprecated macros in Boost.Regex
[SVN r81587]
2012-11-27 14:28:12 +00:00
1136748517 Fix makefile Boost version.
[SVN r80934]
2012-10-10 12:47:40 +00:00
92b059e5a9 Update makefiles.
[SVN r80933]
2012-10-10 12:43:21 +00:00
a26d66b688 Merge collected bug fixes from Trunk:
Refs #589.
Refs #7032.
Refs #7084.
Refs #6346.

[SVN r79556]
2012-07-16 08:38:23 +00:00
8aa4a1225a Merge macro changes for Boost.Regex; no functionality change
[SVN r79532]
2012-07-15 14:42:24 +00:00
4ab0ffee0a Switch from deprecated macros to new shiny ones; no functionality change
[SVN r79418]
2012-07-11 16:21:55 +00:00
c2d2f656da Don't use lib64 and bin64 paths except for msvc builds. Refs #7055.
[SVN r79359]
2012-07-08 16:50:23 +00:00
0e867247fc Apply patch from #6333.
Fixes #6333.

[SVN r79349]
2012-07-08 11:52:20 +00:00
1567185ba2 Add workaround for old broken compilers that don't support template construct/assign to containers.
Fixes #6680.

[SVN r79342]
2012-07-08 07:54:35 +00:00
ab6b0d9971 Fix begin() and end() members and add tests.
Fixes #6346.

[SVN r79340]
2012-07-07 18:36:25 +00:00
3bfba1a7cf Fix regex_iterator and regex_replace to do what grep/sed do for multiple repeats when matching in POSIX mode.
Fixes #589.

[SVN r79339]
2012-07-07 18:08:01 +00:00
e91bd45820 Fix potential memory leak.
Fixes #7084.

[SVN r79338]
2012-07-07 17:07:18 +00:00
8d48db25cc Add check before copying data.
Fixes #7032.

[SVN r79333]
2012-07-07 12:14:09 +00:00
50795bcfec Make sure at least one Boost header (and therefore Boost.Config) precedes std lib headers so that defines in boost/config/user.hpp are seen by system headers.
Fixes #7009.

[SVN r79152]
2012-06-28 10:53:43 +00:00
e18682ca74 Fix some Valgrind reported issues in regex parsing.
[SVN r78940]
2012-06-14 08:37:53 +00:00
5964976b93 Merge warning fixes from Trunk.
Merge Documentation fixes from Trunk.
Merge updated makefiles from Trunk.

[SVN r78577]
2012-05-24 10:03:48 +00:00
1f016f6999 Fix some more GCC warnings.
Fix previous warning suppression which broke tests with GCC.
Refs #6863.

[SVN r78480]
2012-05-15 16:09:12 +00:00
543e912e14 Fix clang warnings.
Fixes #6863.

[SVN r78431]
2012-05-12 08:11:01 +00:00
c822e00b6a Change gcc makefile variable usage.
Regenerate makesfiles.
Fixes #6887

[SVN r78424]
2012-05-11 18:42:47 +00:00
862f6c1515 Fix use of wide character strings so they conform to the new C++11 rules.
[SVN r78218]
2012-04-27 11:35:22 +00:00
b45d6bb70c Fix issue with (?!) not being a valid expression. Update tests and docs to match.
[SVN r77602]
2012-03-28 12:00:34 +00:00
9ab4fb9eff Fix bug in object_cache.hpp
Fixes #6440.

[SVN r76775]
2012-01-29 13:33:03 +00:00
ed90c8cec5 Fix pp-logic.
Refs #6359.

[SVN r76324]
2012-01-05 17:31:34 +00:00
c72bb1b175 Fix Intel-win ICU library names.
[SVN r76322]
2012-01-05 17:27:51 +00:00
eedb7b5063 Add workaround for Intel-12.1 on Windows.
Fixes #6359.

[SVN r76319]
2012-01-05 13:33:48 +00:00
090520dbb4 Merge regex changes from Trunk.
[SVN r76192]
2011-12-26 18:28:30 +00:00
e0fe0863ad Add missing files.
[SVN r76178]
2011-12-26 16:38:17 +00:00
e389d92752 Add BOOST_REGEX_NO_FASTCALL config macro and regenerate docs.
Fixes #6245.

[SVN r76140]
2011-12-24 18:04:37 +00:00
c711849c8a Fix typo and regenerate docs.
Fixes #6154.

[SVN r76139]
2011-12-24 17:51:57 +00:00
806a0ed81a Fix typos.
Refs #6003.

[SVN r76138]
2011-12-24 17:31:27 +00:00
728ef21347 Add missing file.
[SVN r75961]
2011-12-15 11:24:18 +00:00
115a8fe837 Document release history.
[SVN r74978]
2011-10-16 16:51:56 +00:00
56b4ff40cb Update fixed issues in docs.
[SVN r74965]
2011-10-16 12:25:52 +00:00
fe16f3f039 Merge accumulated minor fixes from Trunk.
[SVN r74964]
2011-10-16 12:19:37 +00:00
eecd107870 Added missing typename.
[SVN r74900]
2011-10-10 17:51:27 +00:00
c485b12568 Fix case change bug.
Fixes #698.

[SVN r74898]
2011-10-10 16:55:27 +00:00
f04f7605ce Improve sprintf usage.
Stop passing UDT's through (...) even in meta programs.
Fixes #5958.
Refs #5835.


[SVN r74897]
2011-10-10 15:46:07 +00:00
852bc502cf Allow source to be built by #including all the source files in a single TU.
Fixes #5736.

[SVN r74896]
2011-10-10 15:09:40 +00:00
cc03c77deb Fix code to use checked iterators.
[SVN r74855]
2011-10-09 17:37:05 +00:00
5a0f62f00c Merge minor fixes, plus updates to Unicode iterators to make them safe in the face of invalid input.
[SVN r74014]
2011-08-23 08:47:38 +00:00
d08bfeff25 Add checked constructors to the Unicode iterators that need them.
Update icu support code to use the new checking-constructors.
Update tests to check the full Unicode character range (as of Unicode V6).
Add minimal docs describing the iterators.

[SVN r73271]
2011-07-21 10:01:09 +00:00
490b3a6547 Merge ICU testing fixes from Trunk.
Authorized by Daniel James.

[SVN r72846]
2011-07-02 08:59:55 +00:00
03ef9626ba Set the Unicode locale to a "know good", otherwise a few tests fail on Linux.
[SVN r72816]
2011-06-30 12:23:43 +00:00
2fb19b66e0 Update tests for ICU-4.8 and Unicode version 6.
[SVN r72801]
2011-06-29 18:17:47 +00:00
fbf5c7d62c Fix infinite recursion in bad recursive expressions.
Fix bug that allows invalid regex to go unnoticed and crash later.
Fixes #5613.
Fixes #5612.

[SVN r72612]
2011-06-16 11:27:13 +00:00
6c181b02ba Add some typecasts to prevent copying a buffer twice (makes sure we find the correct overload of assign).
[SVN r72541]
2011-06-10 17:17:14 +00:00
27ad285fbf Fix access violation caused by past-the-end iterator deference for expressions such as ".*?".
[SVN r72540]
2011-06-10 17:03:48 +00:00
bad2122f48 Merge documentation update for Boost.Regex.
[SVN r72016]
2011-05-17 11:00:38 +00:00
cb142a44b6 Add missing docs for (?&NAME) Perlre construct.
regenerate docs.

[SVN r71986]
2011-05-16 17:09:47 +00:00
713264371b Merge minor fix, plus history update to docs from Trunk.
[SVN r71499]
2011-04-26 09:37:16 +00:00
c918ac94ef Update history and regenerate docs.
[SVN r71498]
2011-04-26 09:16:02 +00:00
829f4fd8ab Suppress msvc warning.
Fixes #5504.

[SVN r71496]
2011-04-26 08:12:27 +00:00
afbb54c73b Merge minor fixes from Trunk.
[SVN r71483]
2011-04-25 17:13:42 +00:00
6ed11d27d7 Pass submatches along to token-iterator constructor.
Fixes #5472.

[SVN r71478]
2011-04-25 10:49:26 +00:00
b267c55bc5 Update version number, fixes #5353.
[SVN r71477]
2011-04-25 09:33:51 +00:00
16bf9d8501 Update version number, fixes #5353.
[SVN r71476]
2011-04-25 09:27:11 +00:00
337f7036df Apply patches from #5462.
Add new test case to verify patches are actually working and prevent future breakage!
Fixes #5462.

[SVN r71240]
2011-04-14 07:53:28 +00:00
3ce59d3bbd Fix issue with VC10 not compiling std::messages<unsigned short>.
[SVN r71038]
2011-04-06 17:50:57 +00:00
8872393894 Add info on building/testing ICU with multiple compilers.
Refs #4863.

[SVN r70131]
2011-03-18 16:46:54 +00:00
e7a6721d98 Update docs to reflect fixes for next release.
Fixes #5223.

[SVN r69776]
2011-03-09 18:16:05 +00:00
463417caba Fix bug that prevents turning off multiple Perl-modifiers at once.
Fixes #5223.

[SVN r69775]
2011-03-09 18:12:18 +00:00
813e5f77e3 Merge minor regex lib fixes from Trunk.
[SVN r69625]
2011-03-07 13:23:36 +00:00
7ed55a515e Building with IBM C++ no longer needs a main() entry point.
Fixes #5088.

[SVN r68318]
2011-01-20 10:14:55 +00:00
407e7c7993 Revert [67111] (addition of boost/detail/iomanip.hpp) and all the commits that depend on it. ([68137], [68140], [68141], [68154], and [68165]).
[SVN r68168]
2011-01-15 08:11:51 +00:00
ac5bfb7111 Replacing the use of <iomanip> with <boost/detail/iomanip.hpp> across Boost.
On Linux, GNU's libstdc++, which is the default stdlib for icc and clang,
cannot parse the <iomanip> header in version 4.5+ (which thankfully neither
compiler advises the use of yet), as it's original C++98-friendly
implementation has been replaced with a gnu++0x implementation.
<boost/detail/iomanip.hpp> is a portable implementation of <iomanip>, providing
boost::detail::setfill, boost::detail::setbase, boost::detail::setw,
boost::detail::setprecision, boost::detail::setiosflags and
boost::detail::resetiosflags. 



[SVN r68140]
2011-01-14 02:35:58 +00:00
c499c62caa Update makefiles.
[SVN r67718]
2011-01-06 12:49:58 +00:00
d6e72fc2b7 Update makefiles.
[SVN r67717]
2011-01-06 12:45:47 +00:00
ec3dbbf5d6 Change PDF URL to SF download page.
Merge 64-bit ICU Jamfile patch.

[SVN r67531]
2011-01-01 13:08:10 +00:00
ff361a2a9b Change PDF URL to SF download page.
[SVN r67528]
2011-01-01 12:27:00 +00:00
b60171bdcf Yes another attempt to fix the 64-bit paths issue.
Refs #4864.

[SVN r66699]
2010-11-23 13:09:08 +00:00
dd9d022d7c Another attempt at fixing 64-bit ICU support.
dll-path for 64-bit builds still isn't set correctly.
Refs #4864.

[SVN r66659]
2010-11-21 18:40:59 +00:00
cef369efa5 Search in lib64 and bin64 for ICU binaries.
[SVN r66640]
2010-11-18 18:27:40 +00:00
7170423870 Merge fixes from Trunk.
Fixes #4721.

[SVN r66116]
2010-10-20 12:11:18 +00:00
680588f638 Fix some compiler warnings by using "int" consistently for hash values.
[SVN r66072]
2010-10-18 12:07:14 +00:00
29088ce346 Fix code to handle multiple named-subexpressions with the same name.
Updated test cases to match.

[SVN r65943]
2010-10-13 16:53:13 +00:00
a35cb5b902 Shared libraries now finally work with Mingw GCC-4.5.0.
[SVN r65807]
2010-10-07 15:40:24 +00:00
27eb8e46ff Stop accessing/comparing singular iterators.
Fixes #4708.

[SVN r65800]
2010-10-07 07:23:58 +00:00
cfedb49110 Merge fixes from Trunk - mainly warning suppression.
[SVN r65720]
2010-10-02 11:34:33 +00:00
6fd55b0510 Update version number.
[SVN r65719]
2010-10-02 11:26:53 +00:00
77771ee209 Use call_once in test code to avoid race condition which may otherwise occur.
[SVN r65702]
2010-10-01 08:03:51 +00:00
383f3b2144 Add option to explicitly disable ICU support.
Update docs to describe new ICU config support.

[SVN r65489]
2010-09-20 16:56:48 +00:00
6c24ae2718 Add } to the list of special characters and regenerate docs.
[SVN r65410]
2010-09-13 08:19:25 +00:00
f4d925ad3b Up the warning level, and fix the resulting warnings with msvc, gcc and Intel.
Fix bug in docs and regenerate.

[SVN r65208]
2010-09-03 08:33:13 +00:00
ae013c447c In Perl mode then "something+++" should be an error.
Add the necessary error handling.
Fixes #4608.

[SVN r65145]
2010-08-31 11:25:56 +00:00
6d53e5ecae Change cygwin to use C locale - std::ctype yields incorrect results for xdigit class on this platform.
[SVN r64628]
2010-08-06 09:26:37 +00:00
2b2fbdb026 Add Cygwin/Mingw linkage requirements.
Fixes #4498.

[SVN r64627]
2010-08-06 09:26:12 +00:00
d29ed80b69 Move inline methods class inline to suppress gcc warnings about different linkage specs.
[SVN r64626]
2010-08-06 09:17:42 +00:00
2403e7e0d7 Fix broken workaround code.
[SVN r64619]
2010-08-05 17:26:52 +00:00
09c9e93572 Fix typo and regenerate docs.
[SVN r64216]
2010-07-21 10:37:35 +00:00
fe1fc3ade0 Fix typo, and regenerate docs.
[SVN r64215]
2010-07-21 10:22:29 +00:00
e9ba172c22 Update performance test program to include std::regex.
[SVN r64199]
2010-07-20 14:52:17 +00:00
ac2017ebc7 Update docs to match all the fixes applied to 1.44.
[SVN r64067]
2010-07-16 09:45:45 +00:00
73030b500e Update docs to match all the fixes applied to 1.44.
[SVN r64054]
2010-07-15 17:18:25 +00:00
4741ee7d94 Merge more rebuilt documentation.
[SVN r63771]
2010-07-08 23:13:28 +00:00
446b1d7c6e Rebuild the regex documentation.
[SVN r63768]
2010-07-08 22:49:58 +00:00
73fc09f4a3 Set push and pop pragmas to be guarded by the same logic.
[SVN r63740]
2010-07-08 10:31:00 +00:00
5cef38cfc3 Update the type_traits library to handle rvalue references.
Add is_lvalue_reference and is_rvalue_reference traits.

[SVN r63486]
2010-07-01 15:55:48 +00:00
5fe36e6e56 Merge documentation fixes.
* Use `doc/src/*.css` instead of `doc/html/*.css`.
* Remove wiki and people directories.
* Some documentation fixes.
* Left out `minimal.css` changes and boostbook changes because of clashes.


[SVN r63347]
2010-06-26 12:30:09 +00:00
1feaf060f9 A couple of link fixes.
[SVN r63153]
2010-06-20 18:04:58 +00:00
7754e9962f Update various libraries' documentation build.
Mostly to use the images and css files under doc/src instead of
doc/html, usually be deleting the settings in order to use the defaults.
Also add 'boost.root' to some builds in order to fix links which rely on
it.

[SVN r63146]
2010-06-20 18:00:48 +00:00
9529cb8bc0 Merged accumulated patches from Trunk.
[SVN r62831]
2010-06-12 08:30:11 +00:00
f89e00810d Get gcc linking options consistent.
[SVN r62796]
2010-06-11 11:52:25 +00:00
528cf2abb9 Some lookbehind assertions were accepted when they should not have been.
Fixes #4309.

[SVN r62563]
2010-06-08 12:41:41 +00:00
eaaf00a924 Fix bug in branch reset code.
[SVN r62478]
2010-06-06 12:38:26 +00:00
2e41f13526 Change regex to make use of new Boost.Config macros.
[SVN r62331]
2010-05-30 17:24:45 +00:00
e3dfbd0953 Fix allocator concept to match C++03 requirements in table 32.
[SVN r62120]
2010-05-21 16:20:15 +00:00
132c39a42c Update regex_match requirements.
Fixes #4215.

[SVN r61976]
2010-05-15 09:15:20 +00:00
05636b5c89 Fix numerous VC-10 compiler warnings.
Rewrite ICU configuration to use the new Boost.Build configuration logic.

[SVN r61893]
2010-05-10 12:13:49 +00:00
fa96f4edf1 Change "id" to "idx" to be Objective C++ compatible.
Fixes #2306.
Fixes #4132.
Fixes #4191.

[SVN r61789]
2010-05-05 17:40:07 +00:00
61f4b3360f Update version number in build scripts.
[SVN r61614]
2010-04-27 12:22:46 +00:00
87d5fd1421 Fixed various issues in docs (mostly duplicate bookmarks and broken links) found by inspect tool
[SVN r61437]
2010-04-20 18:49:18 +00:00
a2142edcd3 Disambiguate between boost::ref and std:ref etc.
Suppress some new warnings from VC-10.
Fix singular iterator logic (fixes VC-10 failures).
Fixes #4114.
Fixes #3632

[SVN r61430]
2010-04-20 16:03:14 +00:00
67f5369cae Add support for Boost.Ref in match_results::format.
Update docs accordingly.
Fixes #4020.

[SVN r60678]
2010-03-17 18:20:09 +00:00
446604c734 Highlight the differences between \Z in Boost and Perl.
Regenerate docs.
Fixes #3899.

[SVN r59512]
2010-02-05 17:05:04 +00:00
f9db065c61 Fix typos in docs.
Fixes #3890.

[SVN r59425]
2010-02-02 12:44:32 +00:00
50892585d3 Remove dead code.
[SVN r59415]
2010-02-01 13:12:50 +00:00
d686c89333 Improve regex performance on msvc by removing statically allocated recursion stack, and using a std::vector instead.
[SVN r59414]
2010-02-01 13:10:28 +00:00
c8e56504d9 Suppress a few warnings.
[SVN r59275]
2010-01-27 13:17:51 +00:00
fc6408426d Merge changes in Trunk:
Simplify regex_timer to eliminate regression failure.
  Rename extern "C" function to have a "boost_" prefix.
  Fix recursive-expression related bug, and update tests to match.

[SVN r58885]
2010-01-11 09:55:40 +00:00
e1bd7c7a9b Change name of extern "C" function so it's prefixed with "boost_"
[SVN r58812]
2010-01-08 11:59:23 +00:00
4a826c1ade Speed up the code a little, and stop swapping stream buffers around in case that's the cause of some test failures.
[SVN r58789]
2010-01-07 16:47:02 +00:00
0e1e9804da Fix bug that effects recursive expressions combined with repeats.
[SVN r58722]
2010-01-05 18:04:08 +00:00
e41acbc33f Merge recursive expressions performance update from Trunk.
Merge Makefile update from Trunk.
Merge history update.

[SVN r58542]
2009-12-28 13:07:04 +00:00
f7e16093de Update version history.
[SVN r58540]
2009-12-28 12:57:20 +00:00
c6f3a072e3 Update version numbers in makefiles.
[SVN r58539]
2009-12-28 11:54:52 +00:00
6f8773362e Improve recursion branch-prediction.
[SVN r58466]
2009-12-20 12:56:35 +00:00
ff4eaacbc4 Symbian patches.
Fixes #3764.
Fixes #3763.

[SVN r58342]
2009-12-13 11:40:28 +00:00
ae79f29895 Merge bug fixes from Trunk - see history for full details.
[SVN r58234]
2009-12-08 12:42:33 +00:00
35c63fc141 Fix -Wshadow gcc warnings.
Update and regenerate docs.
Fixes #3718.

[SVN r58154]
2009-12-05 12:15:20 +00:00
a83329dd28 Allow std::locale's to not have a messages facet installed (fixes some STLPort issues).
Allow match_results to handle singular iterators.
Update docs to match.

[SVN r57860]
2009-11-23 10:45:44 +00:00
1f38675c1c Suppress MSVC warning message.
[SVN r57787]
2009-11-19 18:33:12 +00:00
97005c2017 Suppress external templates with Mingw32 - it seems to cause issues with dll's.
Fix match_results.swap.
Add missing namespace qualifiers to ICU code: fixes #3631.

[SVN r57739]
2009-11-18 09:59:42 +00:00
6e1f3dcceb Improved error messages generated for thrown exceptions.
Suppressed "gcc -Wall -Wextra -pedantic" and "msvc /W4" warnings.
Updated and rebuilt docs.


[SVN r57451]
2009-11-07 15:32:45 +00:00
95ddff1f01 Suppress gcc-4.4.1 warnings.
[SVN r57366]
2009-11-04 17:22:59 +00:00
898b49fa89 Fixes #3389.
Updated and regenerated docs.

[SVN r57254]
2009-10-30 18:45:41 +00:00
603e98d186 Fixes #3425.
[SVN r57252]
2009-10-30 18:15:55 +00:00
308c336700 Added support for function objects as well as strings when formatting.
Updated and regenerated docs.

[SVN r57250]
2009-10-30 17:25:12 +00:00
9188464e39 Tighten up error handling and checking.
[SVN r57133]
2009-10-24 15:51:57 +00:00
17ad2e9302 rm cmake from trunk. I'm not entirely sure this is necessary to satisfy the inspect script, but I'm not taking any chances, and it is easy to put back
[SVN r56942]
2009-10-17 02:07:38 +00:00
d8c6fe7ce8 rm cmake from the release branch before it goes out broken. Policy dictates that you never commit to release, you commit to trunk and merge to release.
[SVN r56941]
2009-10-17 01:10:45 +00:00
efd3e2e05c Changes relating to issue #3408.
Add hooks for the dcdflib to the incomplete gamma tests.
Add hooks for the dcdflib to the igamma performance tests.
Some small performance enhancements.

[SVN r56370]
2009-09-24 11:23:52 +00:00
6b4d144be9 Fix for old GCC versions with BOOST_REGEX_BUGGY_CTYPE_FACET defined.
[SVN r55837]
2009-08-28 16:07:13 +00:00
9f9ce59d57 Treat ICU_PATH relatively to current dir.
Also, fix another leading "/" bug.


[SVN r55756]
2009-08-24 09:34:08 +00:00
438dcae4e4 Merge: Don't add leading slash to every path.
[SVN r55732]
2009-08-23 15:53:38 +00:00
2686ab22a2 Don't add leading slash to every path.
[SVN r55731]
2009-08-23 15:50:50 +00:00
7f89732479 Merge: Force shared runtime if using ICU.
[SVN r55699]
2009-08-21 16:55:51 +00:00
75b99d3a37 Suppress GCC warnings.
[SVN r55688]
2009-08-20 17:27:24 +00:00
bae1c80992 Force shared runtime if using ICU.
[SVN r55685]
2009-08-20 12:05:55 +00:00
e3ca2987e4 Apply patch from issue #3354.
Fixes #3354.

[SVN r55683]
2009-08-20 10:43:44 +00:00
a3b2f4031d Merge updates from Trunk.
Fixes #2713.

[SVN r55383]
2009-08-03 12:00:07 +00:00
1ac89c0a54 Allow the Jamfile to work correctly when both HAVE_ICU and ICU_PATH are set.
[SVN r55279]
2009-07-30 10:47:28 +00:00
513a205564 Update version number.
[SVN r55269]
2009-07-29 17:21:36 +00:00
cfc84473cb Update version number.
[SVN r55268]
2009-07-29 17:19:53 +00:00
66b633b417 Added support for (?(DEFINE) blocks and updated the docs accordingly.
Added support for ICU libraries which may be named icui18n.lib on some Win32 platforms.

[SVN r55267]
2009-07-29 17:11:56 +00:00
78f1066b1f Copyrights on CMakeLists.txt to keep them from clogging up the inspect
reports.  This is essentially the same commit as r55095 on the release
branch.



[SVN r55159]
2009-07-26 00:49:56 +00:00
01eadc4ab6 Add basic copyright/license to keep cmake out of the inspection report
[SVN r55095]
2009-07-22 21:51:01 +00:00
5a6bc29d7c Added initial support for recursive expressions.
Updated docs and tests accordingly.

[SVN r54994]
2009-07-17 10:23:50 +00:00
02a629baf7 Simplify and fix PP logic.
[SVN r53729]
2009-06-07 17:50:17 +00:00
5a80ab5ed4 Another tentative VC10 beta fix.
[SVN r53664]
2009-06-06 08:49:30 +00:00
cd0535d368 Try and fix build errors with VC-10 beta.
[SVN r53595]
2009-06-03 11:24:22 +00:00
944a01f39e GCC warning suppression fixes.
Fixes #3071.

[SVN r53274]
2009-05-26 08:31:23 +00:00
d279b2c0a1 Qualify lower_bound with std:: to allow regex to work with Sun CC
[SVN r53088]
2009-05-18 15:42:04 +00:00
aa16fa7fa1 Added Perl-5.10 "branch reset" support.
[SVN r52961]
2009-05-13 09:17:36 +00:00
9d18ba1151 Add support for named and/or subexpressions with indexes > 99 in conditional format expressions.
[SVN r52873]
2009-05-10 09:14:46 +00:00
f310162a85 Merge cmake files release -> trunk.
[SVN r52866]
2009-05-09 22:57:30 +00:00
55d979060c Add support for named sub-expressions.
[SVN r52823]
2009-05-07 09:46:51 +00:00
be62e08702 Regex depends on Thread
[SVN r52816]
2009-05-07 04:37:40 +00:00
30941e330d Added support for \g \K and \R.
[SVN r52592]
2009-04-25 17:32:49 +00:00
7b10b5dac5 Added possessive modifiers ++ *+ ?+ {}+.
Added support for \v and \h as character classes as per Perl-5.10. 

[SVN r52558]
2009-04-23 09:51:31 +00:00
3b8aca5d8b Merge from trunk
[SVN r52379]
2009-04-14 08:33:45 +00:00
ccf465daac Make the wording of messages consistent with other libraries.
[SVN r52333]
2009-04-11 14:43:43 +00:00
8f15600081 Windows CE does not define the wcscoll function from the CRT so, for WinCE, don't try to pull wcscoll from the global namespace into the std namespace.
[SVN r52222]
2009-04-06 21:37:24 +00:00
6f7f8a6886 Allow ICU_PATH path-constant in project-config to work.
It is only affecting build if not ICU_PATH is set on command line.


[SVN r52176]
2009-04-04 21:20:18 +00:00
3e62631ecb Windows CE does not define the wcscoll function from the CRT so, for WinCE, don't try to pull wcscoll from the global namespace into the std namespace.
[SVN r52106]
2009-04-01 14:56:27 +00:00
8586e7a9cd Patch for ICU on AIX.
[SVN r51952]
2009-03-24 10:08:54 +00:00
3e903e9c8e Merge PDF build changes from Trunk.
[SVN r51417]
2009-02-23 18:39:32 +00:00
356be46981 Add PDF generation options to fix external links to point to the web site.
Added a few more Boostbook based libs that were missed first time around.
Fixed PDF naming issues.

[SVN r51284]
2009-02-17 10:05:58 +00:00
15d3eb8f57 Workarounds to allow compilation by Sun studio without the -library=stlport4 option.
[SVN r51221]
2009-02-12 18:11:43 +00:00
48492bb9b5 Fixes #2713: change table initialisation so that it's initialised statically.
[SVN r51103]
2009-02-08 16:30:45 +00:00
083ea3a6c7 merge of cmake build files from trunk per beman
[SVN r50756]
2009-01-24 18:57:20 +00:00
2d43c1b305 Merge FreeBSD patch.
[SVN r50532]
2009-01-10 12:01:09 +00:00
e85cef1120 Fixes #2437.
[SVN r50510]
2009-01-08 09:58:45 +00:00
e81f710567 Merge changes in Trunk.
[SVN r50499]
2009-01-07 13:19:32 +00:00
fd77d00dfd Update version number
[SVN r50498]
2009-01-07 12:29:03 +00:00
d2be09791d Fixes #2623.
[SVN r50422]
2009-01-01 10:23:10 +00:00
840a4ce2f5 Fix gcc warnings.
[SVN r50377]
2008-12-24 10:14:55 +00:00
e4b31ea37f Empty expressions, and empty alternatives are now
allowed when using the Perl regular expression syntax.  This change has
been added for Perl compatibility, when the new [syntax_option_type]
['no_empty_expressions] is set then the old behaviour is preserved and
empty expressions are prohibited.  This is issue
[@https://svn.boost.org/trac/boost/ticket/1081 #1081].

Fixes #1081.

[SVN r50374]
2008-12-23 19:06:04 +00:00
b4152cd74d Fix gcc warnings from ICU wrappers.
Add optional support for marked sub-expression location information.
Add support for ${n} in format replacement text.
Fixes #2556.
Fixes #2269.
Fixes #2514.

[SVN r50370]
2008-12-23 11:46:00 +00:00
c997a1fcc6 msvc warning suppression.
[SVN r50294]
2008-12-16 10:13:24 +00:00
b650e44ff2 Fix for building with /Zc:wchar_t-.
[SVN r49757]
2008-11-14 16:57:19 +00:00
330f23e84c Updating CMake files to latest trunk. Added dependency information for regression tests and a few new macros for internal use.
[SVN r49627]
2008-11-07 17:02:56 +00:00
85192b703d Continuing merge of CMake build system files into trunk with the encouragement of Doug Gregor
[SVN r49510]
2008-11-01 13:15:41 +00:00
3b3a3ce6d1 Merged updated docs with some typo fixes, also adding missing makefile.
[SVN r49460]
2008-10-27 13:52:23 +00:00
fe24031566 Fix typo in regex_replace docs.
Regenerate docs.

[SVN r49443]
2008-10-23 14:52:50 +00:00
5e4ccdf0cf Fix version names in makefiles.
[SVN r49360]
2008-10-16 12:59:28 +00:00
0362d61627 Updated makefiles.
[SVN r49359]
2008-10-16 12:52:17 +00:00
371ad14a3f Merge from trunk
[SVN r49356]
2008-10-16 09:01:02 +00:00
9219aa0b5b Merge inspection report fixes from Trunk: remove tabs.
[SVN r49285]
2008-10-11 16:18:15 +00:00
a2eccc999c Fix inspection report issues: remove tabs.
[SVN r49284]
2008-10-11 16:07:45 +00:00
545993d3eb Suppress configuration messages when not actually building the regex lib.
[SVN r49065]
2008-09-30 10:54:38 +00:00
5471176846 Merge changes from Trunk ready for 1.37.
[SVN r48796]
2008-09-16 11:54:24 +00:00
d70f98e658 Fixes #2306.
Change "id" to "state_id".

[SVN r48751]
2008-09-12 12:40:23 +00:00
18623d00af Fix Jamfile logic: BOOST_REGEX_ICU_OPTS needs to be a list not a string.
[SVN r48574]
2008-09-04 08:36:34 +00:00
30074a601a Add /usr/local/include to the list of include paths for ICU on FreeBSD.
[SVN r48454]
2008-08-29 17:11:18 +00:00
4212c0d915 Update TR1 library to cope with GCC-4.3 in C++0x mode, and in TR1 mode.
Updated regex concepts to match the TR1.
Added "tricky" cmath_test to test for the functions Boost doesn't implement.

[SVN r48413]
2008-08-28 11:02:59 +00:00
1297f92b8a Tentative fix for issue #2244: ICU uses wchar_t as UCHAR whenever sizeof(wchar_t) == 2.
[SVN r48312]
2008-08-23 11:40:58 +00:00
cb5443477b Fix for VC8 without the service pack.
[SVN r48220]
2008-08-19 15:54:39 +00:00
1012d28c32 Fix for issue #2188.
[SVN r48185]
2008-08-17 11:15:07 +00:00
3a15c301db Disable MSVC std lib workarounds if we're really using STLPort or Apache/RW std lib.
[SVN r47880]
2008-07-30 09:35:44 +00:00
756a875620 Merge doc fixes from trunk.
[SVN r47798]
2008-07-25 09:58:49 +00:00
546dd9f6fb Fixes #1940.
[SVN r47795]
2008-07-25 09:28:01 +00:00
be28ad44c7 Tentative fix for some VC failures.
[SVN r47542]
2008-07-18 11:29:50 +00:00
b7d906dff5 Fixes #2097.
[SVN r47320]
2008-07-11 18:00:41 +00:00
6eb35e2cf1 Fixes #2097.
[SVN r47319]
2008-07-11 18:00:15 +00:00
a08e8b5c85 Merge changes from Trunk.
[SVN r47307]
2008-07-11 11:49:03 +00:00
831156d759 Replace a couple of non-ascii symbols.
[SVN r46943]
2008-07-01 09:58:27 +00:00
d7d38da27f Changed POSIX API functions to use the global C locale.
Fixes #1446.

[SVN r46170]
2008-06-05 17:07:42 +00:00
31b68369ae Patch for VC9 explicit template instantiation.
Fixes #1959.

[SVN r46077]
2008-06-03 12:52:55 +00:00
4c105a90a1 Changed behaviour of \B so that it succeeds when the neither adjacent character is a word character.
[SVN r45354]
2008-05-14 11:19:58 +00:00
8928c7737e Added needed #includes to source files.
[SVN r45353]
2008-05-14 11:14:30 +00:00
3704b9c595 Fixes for issue #1871 that prevents duplicate symbol errors with VC++ compilers, when building with /Zc:wchar_t-.
[SVN r44842]
2008-04-28 11:07:14 +00:00
5fdf2752ae Add explicit type cast to fix GCC-C++0X mode error.
[SVN r44437]
2008-04-15 17:50:11 +00:00
c7dda1b549 Fix doc typo from issue #1794.
[SVN r44169]
2008-04-11 08:53:54 +00:00
6e9b9a7995 Doh! Changes to code should actually compile!
A fix for the last change.

[SVN r44145]
2008-04-10 12:46:41 +00:00
e5bc36d7c9 Fix for bug #1790.
[SVN r44128]
2008-04-09 15:32:08 +00:00
9546df1f23 Rebuild a lot of documentation.
[SVN r43650]
2008-03-16 11:38:32 +00:00
c9d1a42e05 Added missing files.
[SVN r43632]
2008-03-15 18:19:11 +00:00
b39edff796 Added missing files.
[SVN r43631]
2008-03-15 18:18:41 +00:00
788c8a8470 Merged doc fixes from Trunk.
[SVN r43352]
2008-02-21 13:23:29 +00:00
e32c5d0888 Added link to PDF docs, and regenerated.
[SVN r43351]
2008-02-21 12:58:15 +00:00
c527b20062 Merge fix fix for inspect issue.
[SVN r43149]
2008-02-07 10:27:23 +00:00
370c429bd6 Added comment to suppress inspect warning.
[SVN r43148]
2008-02-07 10:24:29 +00:00
0915f19c03 Extended leading repeat optimization to more cases.
[SVN r42992]
2008-01-27 18:43:35 +00:00
37040f4bfd Applies fix for issue #1598: added missing #include.
[SVN r42929]
2008-01-23 16:08:44 +00:00
a65bccab1c Merge TR1 patches for VC9 + MS TR1 implementation from main Trunk.
[SVN r42761]
2008-01-14 13:47:39 +00:00
2cbd1c8882 Patch regex concept checks and TR1 library to work with VC9 + MS TR1 feature pack.
[SVN r42751]
2008-01-14 13:17:09 +00:00
8fffb1250e Fix doc typos.
[SVN r42748]
2008-01-14 10:06:29 +00:00
37cd93fc82 Fix documentation typos.
[SVN r42747]
2008-01-14 09:58:36 +00:00
069e845239 Merge bug fixes from main Trunk: these fix security issues reported by Will Drewry.
[SVN r42746]
2008-01-14 09:53:42 +00:00
b1af72fd23 Ooops, fix broken escape sequence.
[SVN r42745]
2008-01-14 09:46:12 +00:00
299086b99c Fix bugs reported by Will Drewry: certain invalid regexes can cause the library to access invalid memory, changed to ensure that the correct exception is thrown long before this happens.
[SVN r42674]
2008-01-11 09:55:43 +00:00
07eaac9e0e Fix typos.
[SVN r42455]
2008-01-04 16:54:35 +00:00
79d7e84f26 Merged typo fixes from trunk.
[SVN r42026]
2007-12-14 10:16:35 +00:00
71fdd5eb44 Fix typos reported by Sebastian Pipping.
[SVN r42025]
2007-12-14 10:11:21 +00:00
45891854d9 Merged fixes for #1471 (warning suppression).
[SVN r41974]
2007-12-11 17:29:58 +00:00
31668ed4be Fixes #1471.
[SVN r41973]
2007-12-11 17:28:15 +00:00
a159bacf3f Merge fixes for #1455.
[SVN r41972]
2007-12-11 17:26:26 +00:00
f72c7518be Fixes #1455.
[SVN r41970]
2007-12-11 17:19:03 +00:00
97daf0f81f Bring into synch with Trunk, and fix regression.
[SVN r41895]
2007-12-08 17:37:40 +00:00
dc01b7833e Full merge from trunk at revision 41356 of entire boost-root tree.
[SVN r41370]
2007-11-25 18:38:02 +00:00
ff95eb8d98 Full merge from trunk at revision 41356 of entire boost-root tree.
[SVN r41369]
2007-11-25 18:07:19 +00:00
2995393609 Oops, previous commit messed up POSIX timing code, now fixed.
[SVN r41359]
2007-11-25 15:47:58 +00:00
7015512292 A few corrections to the WinCE patches
[SVN r41350]
2007-11-25 04:30:02 +00:00
4199529fd0 Apply patches for building regex on WinCE see: http://lists.boost.org/Archives/boost/2007/11/130839.php
[SVN r41327]
2007-11-24 12:25:25 +00:00
cf876f58f0 Added try...catch around TSS initialisation.
[SVN r41301]
2007-11-22 09:59:38 +00:00
d3d99ef6f8 Changed order of #includes to keep Borland C++ 5.5.1 happy.
[SVN r41252]
2007-11-20 11:18:48 +00:00
6b83bf86aa No user32.lib on WinCE
[SVN r41219]
2007-11-19 10:20:36 +00:00
bddeb83175 Changed test to catch throw exceptions from thread creation.
[SVN r41172]
2007-11-17 18:41:29 +00:00
217c317219 Fix WinCE issues.
[SVN r41170]
2007-11-17 12:17:05 +00:00
326f120ffd Disabled use of MS-specific narrow character functions when _WIN32_WCE is defined.
[SVN r41143]
2007-11-16 12:00:32 +00:00
bed800b315 Catch exceptions thrown from thread creation.
[SVN r41089]
2007-11-14 13:03:15 +00:00
f11333d352 Added license info.
[SVN r40900]
2007-11-07 18:26:11 +00:00
15f764a95a added license info in copyright notice at the footer
[SVN r40867]
2007-11-07 03:23:31 +00:00
39eb48c805 Ticket #583.
[SVN r40652]
2007-11-01 18:02:37 +00:00
e84b7e25e1 Fix for http://svn.boost.org/trac/boost/ticket/1381.
[SVN r40649]
2007-11-01 17:16:41 +00:00
005a1b36df Make sure every library can be installed by using
bjam stage|install

in libs/<library>/build.


[SVN r40475]
2007-10-26 09:04:25 +00:00
22d32e97c9 Removed files that are no longer used and regenerated the Makefiles so they are no longer dependent on the removed files.
Hidden some seldom-used dependencies in static_mutex.hpp to reduce library footprint when extracted with bcp.

[SVN r40427]
2007-10-24 17:57:45 +00:00
816f0ba137 Update makefiles and the script that creates them: was generating dependencies that weren't required.
[SVN r40405]
2007-10-24 09:15:20 +00:00
c48d7bb478 Recreate release branch from fixed 1.34.1 tag.
[SVN r40341]
2007-10-23 06:42:50 +00:00
3cd2b52030 Move Attic files back into their rightful places
[SVN r40311]
2007-10-23 01:47:48 +00:00
f2a7f4d8c3 ICU libraries are only available as shared libraries.
[SVN r40214]
2007-10-20 16:30:01 +00:00
4c23414558 Removed ICU options from main requirements: BBv2 barfs at it.
[SVN r40205]
2007-10-20 09:20:30 +00:00
8627f6266c Adjust ICU build support: almost works now :-)
[SVN r40193]
2007-10-19 17:55:44 +00:00
73e23ab857 Updates to build system: Sun and SGI compilers have a problem doing a shared link, and some platforms don't have an icudata library.
[SVN r40128]
2007-10-17 17:15:53 +00:00
9ec9aa9cbc Fully qualified use of "extended" flag, to keep gcc on Solaris happy.
[SVN r40086]
2007-10-16 16:11:30 +00:00
960c0a3bbc Update docs to match quickbook.
[SVN r39727]
2007-10-06 17:46:25 +00:00
5b43cf3051 Fix typo.
[SVN r39725]
2007-10-06 17:40:20 +00:00
445bfd915c Update Jamfiles to make PDF generation easier.
[SVN r39714]
2007-10-05 17:49:12 +00:00
f5af9ba18d Starting point for releases
[SVN r39706]
2007-10-05 14:25:06 +00:00
e1484fc788 Changed call_once to header-only template that takes arbitrary function objects; this changes parameter order
[SVN r39701]
2007-10-05 12:10:06 +00:00
768c8c5d88 Fix up file so it can be compiled in C mode.
[SVN r39490]
2007-09-23 17:49:44 +00:00
4777a02d9b Updated ICU build options to fix build on Darwin and elsewhere.
[SVN r39405]
2007-09-20 12:28:34 +00:00
8f41014bff Added needed include (for CHAR_BIT).
[SVN r39315]
2007-09-16 11:20:25 +00:00
d647ba206d Touched files to force tests to be re-run with new Jamfile.
[SVN r39260]
2007-09-14 09:25:29 +00:00
bf301b3175 Oops, doc update broke the tests, fixed now.
[SVN r39181]
2007-09-10 16:22:35 +00:00
c1d0501834 Added optional code to test SGI rope with Regex.
[SVN r39177]
2007-09-10 10:37:19 +00:00
7768f76a78 Applied fix for http://svn.boost.org/trac/boost/ticket/883.
[SVN r39176]
2007-09-10 10:35:51 +00:00
ff24e8f7e8 Fix for http://svn.boost.org/trac/boost/ticket/1075.
[SVN r38924]
2007-08-25 08:53:29 +00:00
4a147d198d Fixes track issue #775, see http://svn.boost.org/trac/boost/ticket/775.
All regex code should now compile warning free at level 4 with MSCV.

[SVN r38864]
2007-08-23 09:06:24 +00:00
cc45c73234 Fixed include guard.
[SVN r38838]
2007-08-22 12:56:39 +00:00
cf98dcd10d Added some missing match_flag_type options.
[SVN r38626]
2007-08-13 17:54:01 +00:00
e7b65221d1 Tidied up msvc-warning suppression code.
[SVN r38562]
2007-08-10 10:11:03 +00:00
474822492b Remove V1 Jamfiles
[SVN r38516]
2007-08-08 19:02:26 +00:00
3f8b3b5bd1 Removed files that were previously removed from cvs but got resurrected for some reason.
[SVN r38403]
2007-08-02 17:06:26 +00:00
3e68fcb703 This commit was manufactured by cvs2svn to create tag
'Version_1_34_1'.

[SVN r38286]
2007-07-24 19:28:14 +00:00
90ef9ee1e0 Changed "it's" to the grammatically correct "its".
[SVN r38115]
2007-06-30 11:07:06 +00:00
a677b97254 Removed old HTML docs, and redirected indexes to point to new quickbook docs.
[SVN r37944]
2007-06-08 09:27:36 +00:00
7e4d1b570c Initial commit of quickbook generated docs.
[SVN r37943]
2007-06-08 09:23:23 +00:00
5f96b68080 Initial commit of quickbook conversion of docs.
[SVN r37942]
2007-06-08 09:13:34 +00:00
1fe19b815a Ticket #583.
[SVN r37901]
2007-06-05 17:28:18 +00:00
d44bf8c41d Improve ICU support. See http://svn.boost.org/trac/boost/ticket/976
[SVN r37741]
2007-05-22 17:24:25 +00:00
f4877f6698 Added new example.
Updated ICU support for VC8


[SVN r37738]
2007-05-22 09:47:28 +00:00
5b9e134fc4 Added links to PDF docs.
[SVN r37653]
2007-05-09 17:20:56 +00:00
15085e5bb1 Fixes to bug report 1693867.
[SVN r37355]
2007-04-04 10:12:34 +00:00
4f3f622806 Added new test for Perl style formatting with \u and \l.
[SVN r37229]
2007-03-19 13:21:05 +00:00
0f099c863d Fixed Perl style formatting with \l and \u.
[SVN r37228]
2007-03-19 13:20:26 +00:00
2643fcb245 Ooops, fix version check.
[SVN r37115]
2007-02-28 17:18:33 +00:00
6515861db5 Oops, get the namespace right.
[SVN r37111]
2007-02-28 10:08:29 +00:00
7ac90de75a Oops, get the namespace right.
[SVN r37111]
2007-02-28 10:08:29 +00:00
6b3c033e8d Patches for HP aCC and Compaq tru64
[SVN r37106]
2007-02-27 10:13:14 +00:00
2ebe6d4ec7 Patches for HP aCC and Compaq tru64
[SVN r37106]
2007-02-27 10:13:14 +00:00
bb7b1c8def Change asserts to tests.
[SVN r37080]
2007-02-26 09:46:39 +00:00
b93dc9c301 Change asserts to tests.
[SVN r37080]
2007-02-26 09:46:39 +00:00
1b0ab17df9 Reduce thread load so test completes faster.
[SVN r37061]
2007-02-25 10:37:25 +00:00
cce38359c9 reduce thread load so test completes faster.
[SVN r37060]
2007-02-25 10:36:06 +00:00
07016623eb Fixed if...else logic and added cygwin to the list of compilers that need to be statically linked.
[SVN r36984]
2007-02-17 12:22:49 +00:00
a1de8967fa Fixed if...else logic and added cygwin to the list of compilers that need to be statically linked.
[SVN r36984]
2007-02-17 12:22:49 +00:00
4c56f3c14e Only static linking works with mingw
[SVN r36888]
2007-02-04 10:20:33 +00:00
32feb34671 Only static linking works with mingw.
[SVN r36887]
2007-02-04 10:19:37 +00:00
fdde09cad6 Fix version check.
[SVN r36733]
2007-01-15 11:10:53 +00:00
95e3612e72 Fix workaround version.
[SVN r36732]
2007-01-15 11:09:44 +00:00
fdf8aa83ec Update bbv2 instructions.
Update Jamfile with better ICU support.


[SVN r36691]
2007-01-11 17:22:38 +00:00
f7f4f2fafb Update bbv2 instructions.
Update Jamfile support for ICU.


[SVN r36689]
2007-01-11 17:21:37 +00:00
c1722ff3de Disable typeid useage with VC6.
[SVN r36592]
2007-01-05 13:25:04 +00:00
3c07ee04de Disable typeid useage with VC6.
[SVN r36592]
2007-01-05 13:25:04 +00:00
77e43136d1 bbv2 updates.
[SVN r36551]
2006-12-31 17:26:12 +00:00
5e5e24e476 bbv2 updates.
[SVN r36551]
2006-12-31 17:26:12 +00:00
f5449c38a6 This commit was manufactured by cvs2svn to create branch 'RC_1_34_0'.
[SVN r36550]
2006-12-31 17:25:40 +00:00
4f787b3c60 bbv2 updates.
[SVN r36549]
2006-12-31 17:25:39 +00:00
5654efcf98 Fix for grep and egrep syntax types, plus tests.
[SVN r36470]
2006-12-20 17:19:25 +00:00
2a87146c18 Fix for grep and egrep syntax types, plus tests.
[SVN r36470]
2006-12-20 17:19:25 +00:00
8d5985ce42 Typo fix
[SVN r36465]
2006-12-20 09:45:03 +00:00
107d4d5f63 Typo fix
[SVN r36465]
2006-12-20 09:45:03 +00:00
bb8f057d6c Fix for msvc-6 in multithreaded test mode.
[SVN r36344]
2006-12-12 09:57:35 +00:00
d9df4f8154 Fix for msvc-6 in multithreaded test mode.
[SVN r36344]
2006-12-12 09:57:35 +00:00
9002d01f75 Remove obsolete Boost.Build v1 files.
[SVN r35880]
2006-11-06 17:10:46 +00:00
1b5dd57cf6 Update heuristics used to determine max state count, following a bug report from SAP.
Updated tests to match.


[SVN r35656]
2006-10-18 12:56:45 +00:00
b057d0f943 Update heuristics used to determine max state count, following a bug report from SAP.
Updated tests to match.


[SVN r35656]
2006-10-18 12:56:45 +00:00
8ad427474b Remove and update aCC/HPUX fixes.
Fix regex bug report: some repeats match when they should not.
Added test case.


[SVN r35262]
2006-09-21 18:30:27 +00:00
67128fa65f Remove and update aCC/HPUX fixes.
Fix regex bug report: some repeats match when they should not.
Added test case.


[SVN r35262]
2006-09-21 18:30:27 +00:00
9fc486658f Updated aCC config.
Removed aCC workarounds that are no longer needed.


[SVN r34938]
2006-08-24 11:00:19 +00:00
3e2b01cc86 Removed aCC workarounds that are no longer necessary.
Updated aCC config.


[SVN r34937]
2006-08-24 10:59:16 +00:00
f4d849ec8f Trivial fix: macro not correctly bracketed.
[SVN r34878]
2006-08-12 17:51:24 +00:00
a39c66730e Trivial fix: macro not correctly bracketed.
[SVN r34878]
2006-08-12 17:51:24 +00:00
db4120e46d Fixed const-correctness bugs.
[SVN r34785]
2006-07-30 16:14:16 +00:00
4a89e84d7d Fixed const-correctness bugs.
[SVN r34785]
2006-07-30 16:14:16 +00:00
c4d064add8 Added additional thread safety tests.
[SVN r34775]
2006-07-29 16:02:56 +00:00
2f4bde27e0 Added additional thread safety tests.
[SVN r34775]
2006-07-29 16:02:56 +00:00
65347f0f7f Improved const correctness, fixed thread safety bug.
[SVN r34774]
2006-07-29 16:01:48 +00:00
e907a7e6bc Improved const correctness, fixed thread safety bug.
[SVN r34774]
2006-07-29 16:01:48 +00:00
d3b885e20b Disable new test for VC6.
[SVN r34744]
2006-07-26 17:00:36 +00:00
c8ed5f2b74 Disable new test for VC6.
[SVN r34744]
2006-07-26 17:00:36 +00:00
60b6dbf275 Test case for bug report 1526472.
[SVN r34682]
2006-07-23 17:32:03 +00:00
cb519993c4 Test case for bug report 1526472.
[SVN r34682]
2006-07-23 17:32:03 +00:00
443a498845 Fairly trivial patch for bug report 1526472.
[SVN r34680]
2006-07-23 17:30:49 +00:00
0e9ca3fe5f Fairly trivial patch for bug report 1526472.
[SVN r34680]
2006-07-23 17:30:49 +00:00
7a3a6dc7c6 manual merge from trunk: minor code fixes; fixed typos reported in http://bugs.debian.org/378016
[SVN r34636]
2006-07-20 13:54:08 +00:00
37b39f6635 manual merge from trunk: fixed license reference text; added final slash to boost url; fixed typos reported in http://bugs.debian.org/378016
[SVN r34634]
2006-07-20 13:44:08 +00:00
5f0c4a4b22 minor code fixes; fixed typos reported in http://bugs.debian.org/378016
[SVN r34628]
2006-07-20 13:02:31 +00:00
896ca1c8f7 fixed license reference text; added final slash to boost url; fixed typos reported in http://bugs.debian.org/378016
[SVN r34626]
2006-07-20 12:41:22 +00:00
b473011375 Added needed license info.
[SVN r34563]
2006-07-16 17:24:25 +00:00
b8dce0792f Added needed license info.
[SVN r34563]
2006-07-16 17:24:25 +00:00
0a998e8bc8 stripped tabs from file.
[SVN r34560]
2006-07-16 16:06:38 +00:00
975b05d553 stripped tabs from files
[SVN r34559]
2006-07-16 16:05:13 +00:00
eb93be73eb Bug fix.
[SVN r34495]
2006-07-10 09:46:27 +00:00
4bf3ff6ecc Bug fix.
[SVN r34495]
2006-07-10 09:46:27 +00:00
eb791cd1c3 Non-greedy repeat tests from https://sourceforge.net/tracker/index.php?func=detail&aid=1515830&group_id=7586&atid=107586
[SVN r34494]
2006-07-10 09:41:12 +00:00
5928770c46 Fix for non-greedy repeats see https://sourceforge.net/tracker/index.php?func=detail&aid=1515830&group_id=7586&atid=107586
[SVN r34493]
2006-07-10 09:40:35 +00:00
911602a41d Non-greedy repeat tests added.
[SVN r34492]
2006-07-10 09:37:05 +00:00
f29e092dc8 Fixes for non-greedy repeats.
[SVN r34491]
2006-07-10 09:36:28 +00:00
2d6fea3308 Allow match_results::position() to return a valid value for partial matches.
[SVN r34324]
2006-06-17 12:48:03 +00:00
4f90cd5c91 Allow match_results::position() to return a valid value for partial matches.
[SVN r34324]
2006-06-17 12:48:03 +00:00
b58521163b Changed test names to prevent directory/test name conflict.
[SVN r34221]
2006-06-07 16:38:23 +00:00
c666793a92 Changed test names to prevent directory/test name conflict.
[SVN r34221]
2006-06-07 16:38:23 +00:00
921b0d758e Don't apply fix to VC7.
[SVN r34060]
2006-05-22 17:50:33 +00:00
da99b16a87 Don't apply fix to VC7.
[SVN r34060]
2006-05-22 17:50:33 +00:00
dae6cbfead Added extra tests for non-greedy repeats to verify bug fix.
Updated history.


[SVN r34031]
2006-05-19 13:17:00 +00:00
17a038b672 Fix for partial matches and non-greedy repeats.
[SVN r34030]
2006-05-19 13:16:09 +00:00
1039e64792 Added extra partial match tests to verify bug fix.
[SVN r34029]
2006-05-19 13:09:56 +00:00
bbd5f27dd7 Partial match fix.
[SVN r34028]
2006-05-19 13:09:19 +00:00
c4d13296e6 Fix for non-greedy repeats and partial matches not working correctly in all cases.
[SVN r34027]
2006-05-19 13:06:19 +00:00
ccc52a8a63 Fix for duplicate symbol errors when using VC7.1 without /Zc:wchar_t
[SVN r33706]
2006-04-15 17:21:19 +00:00
9e7e1ba009 Fix for duplicate symbol errors when using VC7.1 without /Zc:wchar_t
[SVN r33706]
2006-04-15 17:21:19 +00:00
01cc2aaa50 Fixed silly bug in example.
[SVN r33609]
2006-04-09 10:07:08 +00:00
4a02d7ecde Fixed silly bug in example.
[SVN r33609]
2006-04-09 10:07:08 +00:00
4370fe4607 Added no_except docs.
[SVN r33585]
2006-04-07 10:21:19 +00:00
6e5b5b4cb2 Added no_except docs.
[SVN r33584]
2006-04-07 10:14:13 +00:00
2844e5b8cb Added checks for managed code and __fastcall.
[SVN r33558]
2006-04-05 12:24:17 +00:00
171749f440 Added guards for managed code and __fastcall
[SVN r33557]
2006-04-05 12:22:36 +00:00
dc69badb71 Update to 1.34 version numbers.
[SVN r33427]
2006-03-21 18:45:37 +00:00
10a3b70df1 suppress gcc -Wshadow warnings.
[SVN r33426]
2006-03-21 18:36:44 +00:00
c1c2058d3d Suppress gcc -Wshadow warnings.
[SVN r33425]
2006-03-21 18:35:17 +00:00
1a732d8c6a Updated makefiles to 1.34
[SVN r33424]
2006-03-21 18:30:27 +00:00
f0ae398ada This commit was manufactured by cvs2svn to create branch 'RC_1_34_0'.
[SVN r33417]
2006-03-21 02:26:31 +00:00
f86bd2f3f9 Mingwin Warning suppression.
[SVN r33403]
2006-03-20 10:36:12 +00:00
f847503cc4 Fixed typo.
[SVN r32965]
2006-02-16 13:14:46 +00:00
ead52f741a Fix isses with setting BOOST_REGEX_DYN_LINK when linking to static regex lib.
[SVN r32956]
2006-02-16 09:23:40 +00:00
e6aad1cb3d Statically link to program_options
[SVN r32955]
2006-02-16 09:21:55 +00:00
467bad9f89 Update Jamfile.v2
[SVN r32731]
2006-02-08 12:02:22 +00:00
fe61bdb1b6 Fix a typo
[SVN r32730]
2006-02-08 11:26:27 +00:00
d8754ff99d Update Jamfile.v2
[SVN r32727]
2006-02-08 10:26:25 +00:00
2dbf1804ba Warning supression for VC7.1.
[SVN r32430]
2006-01-27 10:35:04 +00:00
c30c8c281a Appararently we need to include <limits.h> (for gcc-2.95.3)
[SVN r32400]
2006-01-24 17:27:10 +00:00
3f923f1f23 Informative comment
[SVN r32280]
2006-01-10 16:04:17 +00:00
1abb301292 Remove comments that are problematic for compilers using a Far Eastern locale to process.
[SVN r32103]
2005-12-19 13:25:29 +00:00
afc5ce05cd Fix concept check regression, and suppress various VC-related warnings.
[SVN r32014]
2005-12-13 18:30:53 +00:00
9d0e60bd74 Change assert into runtime check - it keeps the VC8 analyser happy.
[SVN r32013]
2005-12-13 17:24:28 +00:00
ef37b58888 Another fix for very large numbers of repeats.
[SVN r31995]
2005-12-12 13:03:05 +00:00
02c6228c77 Fix /analyse errors from VC8.
Update test cases appropriately.


[SVN r31988]
2005-12-11 17:34:32 +00:00
d4b4f359e5 Fix -analyse errors from VC8.
Merge a couple of changes from the release branch.


[SVN r31987]
2005-12-11 17:33:38 +00:00
2635121cc8 Stop calling std::list<>::size(), it's not O(1).
Suppress MSVC warning.
Fix error code for bad repeat range.


[SVN r31833]
2005-11-30 13:56:54 +00:00
9d76e95575 Instantiate more bcc32 v5.1 workarounds.
Fix for Chinese Win32 locales.
Don't test c_regex_traits if it's not present.


[SVN r31768]
2005-11-24 16:37:05 +00:00
1c2ff0ab50 Disable some deffinitions when testing the std::tr1 version.
[SVN r31608]
2005-11-09 17:30:43 +00:00
a0e41a0fd1 Update to reflect recent changes.
[SVN r31597]
2005-11-08 11:36:52 +00:00
b3433fc7c8 Added tests for trailing - in ranges, for example [a-b-].
[SVN r31534]
2005-11-01 18:06:59 +00:00
8a06157b46 Added patches from 1.33 branch:
Fix trailing - in ranges so that [a-b-] works.
Fix performance issue: don't call std::distance on bidirectional iterators.


[SVN r31533]
2005-11-01 18:06:19 +00:00
10a423db6e Added new tests for newly reported bugs.
[SVN r31493]
2005-10-27 10:25:22 +00:00
ffa362ce17 Consolidated patches and performance tweeks.
[SVN r31492]
2005-10-27 10:24:50 +00:00
5fb9181efa Quote pathnames for ICU and STLport.
[SVN r31262]
2005-10-10 16:29:30 +00:00
b5bc6e2be9 Enabled negated character classes inside character sets.
[SVN r31053]
2005-09-20 12:01:25 +00:00
ae36194500 for apples-to-apples, add try/catch to time_boost functions, use syntax_option_type::optimize for dynamic xpressive
[SVN r31024]
2005-09-18 16:31:56 +00:00
badb291912 Updated to get xpressive tests to run correctly, and to use regex_iterators for searching.
[SVN r31018]
2005-09-18 09:25:14 +00:00
5973f3eb07 Have to exclude STLport from some explicit instantiations.
[SVN r31008]
2005-09-16 12:29:15 +00:00
40b7a4902f Fixed remaining zero-width assertion issues.
Added separate file instantiation of ICU support templates.
Ensured code is STLport debug mode clean.


[SVN r30980]
2005-09-14 12:20:41 +00:00
90f4367b8d Ported ICU integration code to VC6/7.
Added some needed std lib #includes.
Reworked gcc separate file template instantiation code.


[SVN r30791]
2005-09-03 11:13:28 +00:00
db5748ae7e Added config and header include changes needed to support MSVC + STLport 5.0.
[SVN r30701]
2005-08-27 10:25:15 +00:00
46b7d89fff Gcc warning suppression.
[SVN r30673]
2005-08-25 17:26:08 +00:00
7ee1a58a84 Large patch from Ulrich Eckhardt to fix support for EVC++ 4.
[SVN r30670]
2005-08-25 16:27:28 +00:00
bfa2168237 gcc+stlport fix.
[SVN r30668]
2005-08-25 12:57:20 +00:00
2f3b212a22 Disabled support for external templates with Intel 8.0 and earlier (it leads to unresolved externals).
[SVN r30643]
2005-08-24 09:59:14 +00:00
d3a9bbfabd Made regex_error backwards compatible with Boost-1.32.
[SVN r30623]
2005-08-22 10:56:15 +00:00
233f083720 Updated History.
Added additional tests for regexes that are supposed to be empty.
Added additional test cases for non-greedy repeats.


[SVN r30605]
2005-08-19 16:12:45 +00:00
c39176085b Fixed VC7.1-STLport config setup so it works with /Zc:wchar_t
Re-ordered code in static_mutex.hpp to satisfy SGI IRIX.
Added some additional #includes to satisfy SGI Irix.
Fixed strange bug where some non-greedy repeats could repeat more times than permitted.
Fixed return value from basic_regex<>::empty().
Fixed return value from basic_regex<>::expression() and basic_regex<>::size() when the expression is invalid.


[SVN r30604]
2005-08-19 16:10:11 +00:00
bf96863756 Updated makefiles: some dependencies have been removed, VC71 and VC8 path setup has been fixed.
[SVN r30546]
2005-08-12 16:05:15 +00:00
bb27376db2 Merged from 1.33.0 release
[SVN r30540]
2005-08-12 13:02:37 +00:00
cbc098536e Merged fixes to broken links from release branch.
[SVN r30458]
2005-08-04 16:06:27 +00:00
9ce6ff7205 Updated history.
[SVN r30113]
2005-07-15 16:32:50 +00:00
bb0ae0940e min/max usage.
[SVN r30036]
2005-07-13 09:38:57 +00:00
6581468288 Fixed broken links.
Fixed min/max references.


[SVN r30005]
2005-07-12 12:39:56 +00:00
dd5e27addb Remove dead files.
Strip tabs from files.


[SVN r30003]
2005-07-12 10:08:11 +00:00
1991c202ed Remove dead files.
Strip tabs from files.
Fix MSVC-specific workaround that doesn't work on Win64.


[SVN r30002]
2005-07-12 09:49:21 +00:00
4781768515 Workaround for Tru64/CXX to avoid multiple definitions of static variables.
[SVN r29907]
2005-07-06 13:08:39 +00:00
6025be01c1 Disable three specific unicode tests for Tru64 which are failing badly.
[SVN r29905]
2005-07-06 13:00:01 +00:00
f353225685 Fix gcc warnings, and use the correct facet!
[SVN r29831]
2005-06-28 15:31:33 +00:00
b2e8ee918f Change constant values to avoid clash with gcc-4 on Darwin.
[SVN r29727]
2005-06-22 09:50:29 +00:00
6064aa15cb Made some member public to keep early EDG compilers happy.
[SVN r29704]
2005-06-20 11:48:37 +00:00
bc6504eda9 Fix for compilers not implementing the resolution to DR45.
[SVN r29699]
2005-06-20 09:22:49 +00:00
8a01dedb52 New vc8 makefile needs to use correct lib name mangling.
Update installation docs for makefiles.
Update regression test makefiles.


[SVN r29678]
2005-06-18 16:55:01 +00:00
35bf922e17 Improve ICU configuration.
Update makefiles.
Add VC8 makefile.


[SVN r29658]
2005-06-17 16:37:41 +00:00
ec74461c36 Undo previous Borland fix, it turns out not to be standards conforming!
[SVN r29657]
2005-06-17 16:35:38 +00:00
799901aafc Fixes to suppress VC7.1 warnings: just rename a few variables to work around the issue.
[SVN r29652]
2005-06-17 11:18:05 +00:00
c18e751bfc Fix for compilers that define BOOST_NO_STD_MESSAGES.
[SVN r29651]
2005-06-17 11:16:56 +00:00
a87dad5cc8 Improved ICU handling.
Brought auto-link test Jamfile up to date.


[SVN r29526]
2005-06-11 14:21:21 +00:00
bbd5296b4e Allow for NUL's.
[SVN r29513]
2005-06-10 10:08:40 +00:00
9e9fc27dc6 Apply patches to regex_iteraor/regex_token_iterator to the unicode iterators as well.
[SVN r29512]
2005-06-10 10:07:49 +00:00
a97324c1c4 Some slight cleanup of vc7 vs. vc-7_0, and msvc vs. vc-6_5.
[SVN r29487]
2005-06-09 00:52:17 +00:00
90b647cdd7 Fix gcc-2.95 compatibility, and supress new warnings from gc-4.0 in protected_call.
[SVN r29407]
2005-06-03 16:10:54 +00:00
80eb2c2bee Updated history, and added format_literal documentation.
[SVN r29378]
2005-06-02 15:55:55 +00:00
ab8f05f2a1 Updated list of macros to print.
[SVN r29317]
2005-05-31 09:46:18 +00:00
7a525369cc Removed unsupported file.
Updated macro list in user.hpp.


[SVN r29316]
2005-05-31 09:45:35 +00:00
69723060e5 Updated build information to make it clear that ICU support is optional.
[SVN r29253]
2005-05-28 11:50:09 +00:00
a56990d55a Internalise Boost.Test dependency.
[SVN r29100]
2005-05-20 15:35:44 +00:00
8aad9e15af Removed VC8 workaround: it's been fixed in Beta 2.
[SVN r29068]
2005-05-19 17:03:09 +00:00
c2de12f113 Disable features that HP aCC can't cope with (gets basic regression tests passing with aCC).
[SVN r29032]
2005-05-18 11:44:12 +00:00
3022a819e6 Don't try and parse thousands separators in number strings (VC8 bug).
[SVN r29031]
2005-05-18 11:43:02 +00:00
9b75e91909 Better spell BOOST_MSVC correctly!
[SVN r28985]
2005-05-17 10:31:53 +00:00
df966c1410 Fix for Borland C++.
[SVN r28984]
2005-05-17 10:24:49 +00:00
9ca851d01f Fix function calling conventions (Borland C++ fix).
[SVN r28949]
2005-05-16 09:57:26 +00:00
28285007cc Fixes for compaq C++
[SVN r28931]
2005-05-15 16:14:47 +00:00
0ae6fb5796 Changed checks to avoid "pointless comparison" warnings.
Change preprocessor code to not use WCHAR_MAX on OSL (Tru64) systems (it's definition is not preprocessor friendly on gcc).


[SVN r28892]
2005-05-14 11:49:50 +00:00
a48a6de286 Fix ICU lib name
[SVN r28862]
2005-05-13 12:31:44 +00:00
e9596db92b Fix como build options to disable thread support.
[SVN r28861]
2005-05-13 12:31:07 +00:00
b912fb5b64 Improve partial match docs.
Fix license on new file.


[SVN r28823]
2005-05-11 14:31:10 +00:00
9a3fee10dd Suppress warnings when exceptions are turned off on gcc.
[SVN r28822]
2005-05-11 14:29:53 +00:00
0d5dcf41d9 Add std::locale-support to grep test as it uses codecvt.
[SVN r28723]
2005-05-07 21:33:22 +00:00
c9f906eb14 Don't need the toupper/tolower code any more - problem solved.
[SVN r28542]
2005-04-30 10:13:55 +00:00
7775706a95 Spell "boost_program_options" correctly.
[SVN r28528]
2005-04-29 15:16:14 +00:00
774981bb52 Must check numeric_limits<charT>::is_specialized before using other members!
[SVN r28527]
2005-04-29 15:04:06 +00:00
90560a3278 Added workaround for old EDG based compilers (SGI cxx compiler).
[SVN r28518]
2005-04-28 16:31:39 +00:00
2e0466d662 Updated/corrected references to Perl.
[SVN r28516]
2005-04-28 16:16:10 +00:00
a694bc1ebb Added some extra tests to try and figure out what the problem with Tru64 is.
[SVN r28505]
2005-04-27 15:50:16 +00:00
b04bc5b5b0 Calls to std::tolower/toupper should cast their argument to an unsigned char.
[SVN r28504]
2005-04-27 15:49:30 +00:00
ed93c55832 Added additional tests for newly discovered regex_iterator bug.
[SVN r28385]
2005-04-21 15:54:54 +00:00
d3a8abb5ef Fix to stop \A from matching successive matches.
[SVN r28384]
2005-04-21 15:54:07 +00:00
5473345609 Added workaround for Tru64/CXX-6.5.
[SVN r28323]
2005-04-19 15:05:23 +00:00
112422adc9 Reworked separate file template instantiation code, to use non-template forwarding functions instead - it works on more compilers that way.
[SVN r28295]
2005-04-17 14:44:37 +00:00
1d1fadeb5a Disabled reverse_iterator tests for broken Rogue Wave library versions (workaround for old sunpro compilers).
[SVN r28294]
2005-04-17 14:43:28 +00:00
c81ebebd32 Added needed include (really only applies to gcc-2.95).
[SVN r28293]
2005-04-17 14:41:56 +00:00
3e5efe81d2 Made this header C compatible.
[SVN r28292]
2005-04-17 14:38:24 +00:00
91b21e78ff Added better documentation on POSIX-conformance.
[SVN r28278]
2005-04-16 16:06:45 +00:00
5d1f265345 Moved new #include to central location with the rest of the includes.
[SVN r28273]
2005-04-15 15:39:26 +00:00
506cd316b2 add #include <algorithm> because we use std::swap()
[SVN r28249]
2005-04-14 15:50:22 +00:00
c2c5b3f726 Don't link posix_api_check to program_execution_monitor. It's unused and
causes link errors for shared linking, due to unresolved reference to cpp_main.


[SVN r28209]
2005-04-13 09:38:09 +00:00
21c368964f Removed dead file (it's been moved to boost/regex/pending).
[SVN r27949]
2005-04-04 10:13:30 +00:00
de28eb9b18 1) Disabled recursive implementation for VC8: stack overflows can't be reliably detected unless the whole program is compiled with asynchronous exceptions.
2) Changed std::copy calls on VC8 to avoid "dangerous code" warnings.
3) Moved backreference and octal escape code into line with POSIX-extended requirements.
4) Changed match_results leftmost-longest rules to stop unnecessary std::distance computations (an optimisation for non-random access iterators).
5) Changed C lib calls to use "safe" versions of string API's where available.
6) Added many new POSIX-extended leftmost-longest tests, to verify the above.


[SVN r27880]
2005-03-30 11:38:51 +00:00
ca144bb2b3 Make it sure this compiles when there's no exception handling support.
[SVN r27578]
2005-03-08 17:28:45 +00:00
a2f958b60c Anything that shares VC6's runtime has the same issues with setlocale that VC6 does.
[SVN r27516]
2005-02-28 10:55:15 +00:00
7c5e1f05c4 Added fix for compilers without <locale>.
[SVN r27515]
2005-02-28 10:54:12 +00:00
ef25339d94 Don't test locales with MSVC: setlocale sometimes bombs out.
[SVN r27503]
2005-02-25 11:04:11 +00:00
31370cd498 Updated concepts to match the TR.
[SVN r27472]
2005-02-21 12:27:23 +00:00
ea94315d6b Fix mutex linking problems.
[SVN r27421]
2005-02-19 11:42:04 +00:00
f736d985fb Update docs on empty alternatives.
[SVN r27419]
2005-02-18 17:15:24 +00:00
ecd5dd5ff3 Allow sort keys to contain nothing but a single NUL character (characters may be ignorable).
[SVN r27408]
2005-02-17 12:44:16 +00:00
077f211f2f Compiler specific fixes and workarounds.
[SVN r27273]
2005-02-09 13:16:39 +00:00
2ee7ef601c include needed <iostream>
[SVN r27272]
2005-02-09 13:15:27 +00:00
eff6f06792 Made min/max usage conform to our guidelines.
Changed Boost.test usage to conform to new interface.


[SVN r27271]
2005-02-09 12:33:18 +00:00
1df0b9cacd Added more info about sort keys from traits classes.
[SVN r27246]
2005-02-08 16:54:36 +00:00
c3f16e3834 SunPro test program fix.
[SVN r27147]
2005-02-05 13:12:23 +00:00
012fe3a99d replaced BOOST_TEST
[SVN r27053]
2005-02-03 13:24:55 +00:00
dbb39f3589 Changed assert code to try and clear up a mysterious sunpro problem.
[SVN r26958]
2005-01-31 11:06:54 +00:00
40735d5630 Added another check to try and diagnode sunpro issue.
[SVN r26898]
2005-01-28 13:37:41 +00:00
d28ac18da2 Need some more tests to track down remaining issues.
[SVN r26845]
2005-01-25 17:22:50 +00:00
29df3606a1 Some fixes for MWCW, broken compilers etc.
[SVN r26834]
2005-01-24 11:05:45 +00:00
3bedef8c4e Updated more license terms.
Added new informational program to try and track down issues with std::collate, and std::ctype.


[SVN r26803]
2005-01-22 16:32:01 +00:00
c04cb21103 Added BOOST_REGEX_BUGGY_CTYPE_FACET to list of macros to print.
[SVN r26800]
2005-01-22 13:14:11 +00:00
56fadadba8 More Sunpro std::distance fixes.
Changed Dr John Maddock to John Maddock


[SVN r26793]
2005-01-21 17:28:42 +00:00
d7e194585d More std::distance fixes for Sunpro.
Changed Dr John Maddock to John Maddock.


[SVN r26791]
2005-01-21 17:22:39 +00:00
e874d7710b Rewritten format method, to avoid ambiguous function call.
[SVN r26760]
2005-01-20 11:10:44 +00:00
ca338db5ae Removed erroneous charT references.
[SVN r26759]
2005-01-20 11:10:28 +00:00
018fbfec05 Changed legacy referernces to reg_expression to basic_regex
[SVN r26740]
2005-01-19 13:29:43 +00:00
b7cb69bae3 Removed one dead file.
Changed legacy referernces to reg_expression to basic_regex


[SVN r26739]
2005-01-19 13:28:57 +00:00
8545aeb1f3 Fixed primary equivalence classes, so that delimiter based sort keys with a delim in position 0 still work.
[SVN r26738]
2005-01-19 11:13:53 +00:00
2a248d1f87 Changed assert's to BOOST_ASSERT's.
Made array sizes explicit to fix MWCW problems.


[SVN r26723]
2005-01-18 12:52:40 +00:00
9781fe3150 Removed dead files.
Changed some asserts to BOOST_ASSERT.
Disabled collation in one test (locale dependent behaviour fails on some platforms).


[SVN r26722]
2005-01-18 12:51:26 +00:00
c8c4c1c289 Fix for libstdc++ debug mode assertions: singular iterators can not be copied, so insertion into a container requires extra special care.
[SVN r26718]
2005-01-17 16:56:14 +00:00
5ef242d146 Disable some tests for MWCW
[SVN r26717]
2005-01-17 12:11:47 +00:00
c2db73aec7 Cleaned up non-standard behaviour in traits classes.
Suppressed explicit instantiations for older Intel versions.
Added std::distance workaround for Sunpro.


[SVN r26716]
2005-01-17 12:10:48 +00:00
30acb7d2f8 Rewritten grep example program.
"touched" some of the sources to force regression tests to rebuild.
Split test code up some more to help msvc-stlport.


[SVN r26705]
2005-01-15 12:29:59 +00:00
1e48609cfd Patches for MWCW and gcc-4.0.
[SVN r26704]
2005-01-15 11:23:46 +00:00
34355d3e79 Added fix for msvc+STLport.
[SVN r26696]
2005-01-14 11:19:46 +00:00
434f3589a5 Added MWCW fix.
[SVN r26695]
2005-01-14 11:10:22 +00:00
71a0e020e2 merged changes in regex5 branch
[SVN r26692]
2005-01-13 17:06:21 +00:00
de0ab9092a Fix for .{n,} failing in partial matches.
Fix for [\x0-\xff] failing in wide character expressions.


[SVN r26566]
2004-12-21 17:07:46 +00:00
ab6f20486b Fix problem with match_any and POSIX-style matches (match results structure wasn't getting filled in).
Fixed problem with gcc in -pedantic mode.


[SVN r26348]
2004-11-29 13:50:17 +00:00
916dbeadbf merge RC_1_32_0 fixes
[SVN r26333]
2004-11-28 04:44:21 +00:00
9079cc8201 Updated installation notes.
[SVN r26323]
2004-11-27 11:20:37 +00:00
e2c97fbb13 Enable auto-linking for compilers other than MSVC.
[SVN r26147]
2004-11-08 12:24:18 +00:00
bc140f1948 Added fix to ensure that expressions prefixed with \` do not scan through the text unnecessarily.
[SVN r25625]
2004-10-08 12:45:31 +00:00
24fec31d2c c++boost.gif -> boost.png replacement
[SVN r25573]
2004-10-05 15:45:52 +00:00
ad21d2cb2f Stamped on more C++ style comments in C compatible code.
[SVN r25472]
2004-09-29 10:22:04 +00:00
50dccbe6e0 Removed mingw workaround, and added to mingw toolset instead.
[SVN r25457]
2004-09-28 14:56:13 +00:00
396136146f Cleaned up comments to make regex.h C compatible.
[SVN r25414]
2004-09-26 10:25:31 +00:00
c0e6b1f5a2 mingw dll specific fixes.
Disable one SGI test - compiler deduces template arguments strangely.


[SVN r25270]
2004-09-20 12:31:08 +00:00
138d526839 Made config header C compatible.
Added mingw dll specific fix.


[SVN r25269]
2004-09-20 12:28:37 +00:00
8e60fd2cb7 Added needed include (fix for RW STL on Linux)
[SVN r25192]
2004-09-18 10:32:45 +00:00
5dfe10a136 Fix for RW STL: undef wchar symbols before use
[SVN r25191]
2004-09-18 10:32:05 +00:00
c2b82eae1f License update
[SVN r24990]
2004-09-09 13:59:01 +00:00
b0a325cf65 Fix: re-used match_results structure didn't set size correctly.
[SVN r24744]
2004-08-26 10:41:49 +00:00
54be0eaa9d VC6-specific fixes for wide character convenience functions.
[SVN r24600]
2004-08-19 15:29:21 +00:00
276fa31266 Fix signature to operator!=
[SVN r24499]
2004-08-16 11:22:52 +00:00
2e968dea9c Minor workarounds for SGI and Darwin platforms.
[SVN r24340]
2004-08-08 09:48:10 +00:00
97d3cdad83 Makefiles updated with 1.32 version number.
[SVN r23982]
2004-07-23 11:35:03 +00:00
99f8d02805 Documentation update from Jon T. Pedant
[SVN r23847]
2004-07-20 17:03:55 +00:00
7043e5585f Ooops, last fix had a misplaced "typename" in it, and therefore was not legal code, strangely some compilers just didn't care.
[SVN r23831]
2004-07-20 10:38:44 +00:00
048d5b788c Added missing copyright declarations.
[SVN r23723]
2004-07-18 10:21:47 +00:00
ee631c02eb Need to make string_out_iterator a "real" iterator type to keep commeau compiler happy.
[SVN r23722]
2004-07-18 10:20:56 +00:00
4600a25228 Updated makefiles.
[SVN r23625]
2004-07-16 10:56:15 +00:00
aebb44e507 Don't include integer_traits.hpp unless it's actually used: IBM C++ trips up otherwise.
[SVN r23317]
2004-07-02 10:40:53 +00:00
8d994b14b2 remove std_min and std_max, update minmax coding guidelines
[SVN r23162]
2004-06-23 04:49:48 +00:00
d310bc9835 HP aCC patches.
[SVN r23147]
2004-06-22 12:42:16 +00:00
6c02074270 More aCC portability fixes.
[SVN r23145]
2004-06-22 12:34:04 +00:00
ca44c8182c Fixed bug with grepping for literals.
Added Sunpro workaround.


[SVN r23093]
2004-06-12 10:10:07 +00:00
2e10c5ec17 Update
[SVN r23089]
2004-06-11 11:54:08 +00:00
ba148bae42 64-bit portability fix
[SVN r23065]
2004-06-09 12:12:42 +00:00
7c74a98ae5 64-bit portability fix
[SVN r23063]
2004-06-09 11:23:52 +00:00
9424952e8f Added workarounds for Sunpro and HP aCC
[SVN r23032]
2004-06-05 11:46:45 +00:00
c3f14400b0 Moved detail/allocator.hpp into regex directory.
[SVN r22967]
2004-05-28 12:21:44 +00:00
55a6787950 Altered initialiser order to stop gcc from complaining.
[SVN r22876]
2004-05-20 10:16:09 +00:00
4c0572d98f Attempt to sync V2 Jamfiles with V1 ones, again...
[SVN r22846]
2004-05-17 07:45:33 +00:00
25e51d3984 Patch for nosubs flag bug.
[SVN r22821]
2004-05-14 10:27:13 +00:00
c9b37542c5 Added additional tests for new bugs
[SVN r22813]
2004-05-13 12:33:22 +00:00
6382470ac1 Fixed \l and \u so that they work correctly in case insensitive mode.
[SVN r22804]
2004-05-12 11:39:28 +00:00
1dc081e1c2 Fixed problem with wide character optimisations, changed asserts on pointers (HP-specific workaround).
[SVN r22721]
2004-05-03 11:24:58 +00:00
b3e28896b7 Changed ar to $(AR) to allow for override.
[SVN r22713]
2004-05-01 10:33:47 +00:00
76176b302b Don't optimise leading repeats when there are backreferences involved.
[SVN r22705]
2004-04-25 10:32:09 +00:00
a262f28327 Added introductory comment
[SVN r22641]
2004-04-17 10:56:46 +00:00
e3aacc5c55 Fixes for POSIX regexes not grepping correctly.
[SVN r22623]
2004-04-09 15:55:32 +00:00
dc90d07749 Added fix for grepping for POSIX style matches.
[SVN r22621]
2004-04-07 11:04:06 +00:00
300ca31723 Added missing hyperlink
[SVN r22620]
2004-04-07 10:49:50 +00:00
c65dd3be41 Added link to old docs.
[SVN r22530]
2004-03-20 12:12:03 +00:00
5a29047906 Added missing preconditions, and fixed minor typos.
[SVN r22529]
2004-03-20 11:53:56 +00:00
cdd130ae2d Added typedefs to index
[SVN r22511]
2004-03-17 12:53:57 +00:00
9f47972bcf Removed unneeded export specifiers
[SVN r22506]
2004-03-16 17:37:54 +00:00
0633ba70f2 Added missing typedefs
[SVN r22505]
2004-03-16 17:36:15 +00:00
8330b19cec Added tests to check new format specifiers.
[SVN r22487]
2004-03-12 13:13:14 +00:00
b8eab985e5 Added support for perl style \u \U \l \L etc in formatting.
[SVN r22486]
2004-03-12 13:12:33 +00:00
f90d8c667e Fixed typo
[SVN r22438]
2004-03-05 11:32:34 +00:00
4b7f14e72d Added extra non-greedy repeat tests,
fixed concept checks for vc6 (they don't work, and won't work).


[SVN r22423]
2004-03-02 17:00:15 +00:00
89515b9a8e Fixed nasty non-greedy repeat bug,
tidied up min/max workarounds,
removed unneeded #if


[SVN r22422]
2004-03-02 16:58:50 +00:00
3075aaba4a remove minmax hack from win32.hpp and fix all places that could be affected by the minmax macros
[SVN r22394]
2004-02-26 18:27:02 +00:00
50b8204753 Updated iterator defs.
[SVN r22387]
2004-02-25 12:36:45 +00:00
02c652c01e Added extra iterator based tests
[SVN r22385]
2004-02-25 12:35:08 +00:00
b3f7d35f68 Added extra acknowledgements
[SVN r22384]
2004-02-25 12:34:42 +00:00
f1312f16c4 Cleared up references to implementation specific types.
[SVN r22190]
2004-02-07 13:11:54 +00:00
9ebe515adf Fixed errors in docs:
unsigned int changed to match_flag_type in several places,
plus occurance of std rather than boost.


[SVN r22160]
2004-02-04 11:57:35 +00:00
c9efbea4a7 Added more tests to catch some additional regressions.
[SVN r21526]
2004-01-07 12:02:58 +00:00
6cbda47155 Added last minute patch for .*?$ failing in the non-recursive algorithm.
[SVN r21525]
2004-01-07 12:00:51 +00:00
3e60ca3481 Added tentative fix for AIX shared lib.
[SVN r21425]
2003-12-30 12:09:03 +00:00
3026d5e6c6 Added missing std:: prefix.
[SVN r21413]
2003-12-29 11:38:03 +00:00
f3088d1c77 Fix broken links.
[SVN r21404]
2003-12-27 02:37:02 +00:00
f82771be8c Fix tabs in file.
[SVN r21399]
2003-12-26 23:26:49 +00:00
02f6fd45b8 Updated history.
[SVN r21370]
2003-12-22 12:35:09 +00:00
9058b985a9 Fixed mis-spelling of __MWERKS__, hopefully fixed regex_token_iterator failure on MWCW as well.
[SVN r21363]
2003-12-21 16:32:02 +00:00
65f6604b24 Only disable cpp_regex_traits<wchar_t> if we are in weird dual-wchar_t mode.
[SVN r21359]
2003-12-20 13:34:34 +00:00
16d6b87b1b Removed <native-wchar_t>on requirement (it's on by default for vc7 anyway, and vc7+stlport is better without it)
[SVN r21354]
2003-12-20 12:55:02 +00:00
82572db442 Disabled dual wchar_t mode with vc7 + STLPort, as it doesn't work.
[SVN r21352]
2003-12-20 12:52:27 +00:00
80104e292d Added needed C header includes
[SVN r21334]
2003-12-19 11:40:31 +00:00
be01708af3 Added checks for bad input files
[SVN r21321]
2003-12-18 11:53:47 +00:00
39f1fb4d17 Changed name of a local variable to hopefully suppress gcc3.4 error
[SVN r21300]
2003-12-17 12:05:59 +00:00
b84b17b3c4 Added BOOST_REGEX_V3 compatibilty workarounds.
[SVN r21288]
2003-12-16 13:06:01 +00:00
2c3ff62e1b Added explicit calls to fstream::close rather than relying on destructors as a tentative gcc-cygwin fix.
[SVN r21287]
2003-12-16 13:05:22 +00:00
7858e47a26 Refactored code so that __try statements only call bool (void) functions.
[SVN r21286]
2003-12-16 13:04:01 +00:00
cd0072b3e7 Added patch for BOOST_REGEX_V3 compatibility
[SVN r21285]
2003-12-16 13:02:57 +00:00
bf9350aa16 Added new experimental captures support.
[SVN r21243]
2003-12-13 12:28:48 +00:00
6b95ac002e Suppressed __try blocks in MWCW.
[SVN r21221]
2003-12-11 11:50:57 +00:00
7f93cee9af fixed msvc-stlport builds.
[SVN r21168]
2003-12-07 13:09:44 +00:00
e79458b0e3 Added ugly workaround for linker errors from bcb5
[SVN r21167]
2003-12-07 12:52:18 +00:00
207b0c63cd Changed to use new iterator typedefs.
[SVN r21161]
2003-12-06 12:11:49 +00:00
f6b9c3d809 Added como specific fix for C builds.
[SVN r21160]
2003-12-06 12:10:27 +00:00
a008c722a4 Added new iterator typedefs
[SVN r21148]
2003-12-05 13:01:54 +00:00
dddfc1a63a Refined building without /Zc:wchar_t on msvc 7 and above
[SVN r21147]
2003-12-05 13:01:29 +00:00
a247f4d7f8 Added new typedefs for iterator types
[SVN r21146]
2003-12-05 13:00:59 +00:00
84c2228b3f Added support for BOOST_ALL_NO_LIB
[SVN r21119]
2003-12-03 13:32:05 +00:00
ebc12d24c9 Patched up support for the new Borland 6.0 compiler in strict mode.
[SVN r21035]
2003-12-01 11:52:28 +00:00
1a50827c46 stripped tabs from files
[SVN r21011]
2003-11-30 13:06:58 +00:00
d19f04af7b Fix broken link
[SVN r20986]
2003-11-28 15:17:45 +00:00
2e9fa8c8f8 Updated build system.
Fixes for vc7+stlport


[SVN r20952]
2003-11-26 11:46:19 +00:00
c642977acd Patches for vc7+stlport
[SVN r20951]
2003-11-26 11:44:53 +00:00
27875c1e55 Fix gcc -Wshadow warnings
[SVN r20857]
2003-11-19 12:57:50 +00:00
42337410fc Added tests for Windows compiler auto-linking
[SVN r20804]
2003-11-13 12:46:27 +00:00
aa132bec5d removed unneeded version calculation
[SVN r20803]
2003-11-13 12:44:18 +00:00
d0258375ae Added support for BOOST_ALL_DYN_LINK
[SVN r20802]
2003-11-13 12:17:49 +00:00
7ba011232c Removed define that disables auto-linking for bjam builds since it is no longer required.
[SVN r20774]
2003-11-10 11:26:39 +00:00
6bb6cddad6 Added [common-names] tags to dll and lib builds.
Added <native-wchar_t>on build requirement


[SVN r20765]
2003-11-08 13:16:53 +00:00
f9d0907868 Fixed up traits classes so that no matter whether /Zc:wchar_t is specified for vc builds or not, then we can still link to the same lib build.
[SVN r20764]
2003-11-08 13:02:55 +00:00
8324fad77c Tidies up new code, fixed one bug.
[SVN r20635]
2003-11-04 11:30:44 +00:00
23f71d7727 Changed regex_token_iterator to return a sub_match rather than a std::string (it's more efficient).
[SVN r20613]
2003-11-03 11:25:30 +00:00
de9338cedf Updated regex build system and tests to match the new Boost.Install code.
[SVN r20604]
2003-11-02 12:13:16 +00:00
dc3878df84 Added new macro BOOST_LIB_VERSION to version.hpp so that auto-linking code knows what version suffix to append to library file names.
Updated auto-linking headers to match new Boost.Install code.


[SVN r20602]
2003-11-02 11:43:56 +00:00
aa68609a60 New warning supression code doesn't work for VC6 :-( So work around the workaround...
[SVN r20493]
2003-10-25 11:20:35 +00:00
a804285fb6 Changed email address to john@johnmaddock.co.uk
[SVN r20472]
2003-10-24 11:13:42 +00:00
8b4da77f83 Undone unintended commit on this file.
[SVN r20471]
2003-10-24 11:00:29 +00:00
2606d1bdd1 Updated copyrights
[SVN r20470]
2003-10-24 10:51:38 +00:00
9215a04042 Mostly cgg warning suppression, plus some gcc 2.95 workarounds.
[SVN r20462]
2003-10-23 12:40:47 +00:00
f7eb12d9c7 Updated tests to check new sub_match non-member operators.
[SVN r20444]
2003-10-21 11:19:42 +00:00
515044821c Updated docs to include recent changes, and improve general quality.
[SVN r20443]
2003-10-21 11:18:40 +00:00
72a7a13565 Added new sub_match operators.
Made member operators const.


[SVN r20442]
2003-10-21 11:14:13 +00:00
63778bea05 Add install definitions for new common install configuration.
[SVN r20409]
2003-10-19 19:52:56 +00:00
54e9a2fbcb Changed no-exception behaviour to call throw_exception directly so that the handler sees the actual error message.
[SVN r20361]
2003-10-13 11:45:11 +00:00
ff1c0a0bb5 Moved common build options into build/Jamfile
[SVN r20355]
2003-10-12 11:19:15 +00:00
c23a7a8cfe Fixed no exception handling builds
[SVN r20330]
2003-10-10 12:13:23 +00:00
651256800f Add V2 Jamfile
[SVN r20273]
2003-10-07 10:45:15 +00:00
696fa47670 Add V2 Jamfile
[SVN r20272]
2003-10-07 10:34:27 +00:00
ab5a7a768d Added new licence info.
[SVN r20254]
2003-10-04 11:29:20 +00:00
a669854a84 renamed null re_null in case the compiler #defines null.
[SVN r20240]
2003-10-02 11:06:06 +00:00
11ea8aab76 switched over to new Boost Licence
[SVN r20232]
2003-09-30 13:02:51 +00:00
ee85ed89a1 Added checks on constructor and assign member function usage.
[SVN r20230]
2003-09-30 11:41:40 +00:00
13dfa17e63 Changed to make use of iterators and not strings where possible.
[SVN r20229]
2003-09-30 11:40:47 +00:00
182616ea25 Changed char_type to be the type used by the regex object not the iterator - allows code to compile where the iterator enumerates types that are different to the regex type.
[SVN r20228]
2003-09-30 11:39:41 +00:00
83306608a7 Fixed template constructor and assign member function iterator usage.
[SVN r20227]
2003-09-30 11:38:30 +00:00
f3c1b8d784 Added fix for broken VC++ preprocessor
[SVN r20226]
2003-09-30 11:37:04 +00:00
3b27d5a38e Use the import rule
[SVN r19968]
2003-09-08 17:38:49 +00:00
567d76e8e4 Fixed Borland compiles, so that regex can be mixed with vcl.h.
[SVN r19880]
2003-08-30 10:14:56 +00:00
51ef8177d3 Fixed Borland warning suppression.
Changed config to use BOOST_HAS_DECLSPEC


[SVN r19781]
2003-08-26 10:49:41 +00:00
2e1ed31f34 Fixed spelling of "BOOST" - basically a enormous cut and paste error!
[SVN r19581]
2003-08-14 10:22:05 +00:00
ccc9c16e93 Added fixes for tests which are unsupported on some platforms.
[SVN r19548]
2003-08-12 12:03:25 +00:00
4e412a1774 Various minor warning suppressions.
[SVN r19547]
2003-08-12 11:24:09 +00:00
e4248fcb19 Moved some config code into boost.config (ABI and lib selection code).
[SVN r19546]
2003-08-12 11:23:02 +00:00
ae95ac6ad0 Fixed STLPort detection
[SVN r19413]
2003-08-03 11:44:41 +00:00
feb3f7bc40 name required for wide_posix_api_check_c
[SVN r19368]
2003-07-30 20:43:35 +00:00
b66ac65061 Disabled tests that are causing problems for the regression testers
[SVN r19361]
2003-07-30 12:16:32 +00:00
d695b70ee9 Added check to prevent macro redeffinition
[SVN r19360]
2003-07-30 12:15:45 +00:00
222b16693c Added tentative como fix
[SVN r19320]
2003-07-27 10:55:35 +00:00
6750cf4892 Modified wide character tests to warn not fail when no wide character support is available in the platform.
Modified Jamfiles to use centralised options.
Added wide character concept check.


[SVN r19318]
2003-07-26 11:22:17 +00:00
9d565f63ed Added Como dll export options.
[SVN r19317]
2003-07-26 11:12:32 +00:00
8a5b00c128 Added needed const qualifier on out of line deffinition.
[SVN r19306]
2003-07-25 11:57:19 +00:00
11f535596b Added fix for SGI64 (std::messages::open appears to require a non-const reference on that platform :-( )
[SVN r19305]
2003-07-25 11:27:17 +00:00
bba214f904 Added out of line deffinition for integral constant.
[SVN r19304]
2003-07-25 11:20:39 +00:00
8be91f0568 Added SGI-Irix tentative fix.
[SVN r19228]
2003-07-20 11:17:15 +00:00
cddfd077a8 Added tentative fix for Metrowerks problem.
Removed Intel test code.


[SVN r19227]
2003-07-20 11:16:26 +00:00
41e54c1cf2 Added temporary Intel diagnostic code
[SVN r19211]
2003-07-19 12:12:50 +00:00
0f2f6b6dfc changed MSVC calling convention setup - can't use __fastcall in debug mode especially with /RTC
[SVN r19190]
2003-07-18 11:25:34 +00:00
ff80be2019 avoid gcc "signed/unsigned" warning
[SVN r19128]
2003-07-15 15:55:59 +00:00
8e03097d9d Added explicit bounds to the array variables to work around Mtrowerks problems.
Added extra check before setting dllexport options.


[SVN r19095]
2003-07-13 11:27:05 +00:00
e12105e591 Added casts to (unsigned char) to suppress warnings from picky compilers.
Changed array initialisation to take account of it's true size (bug fix).


[SVN r19087]
2003-07-12 11:51:36 +00:00
1c915e3fda Disabled workarounds for SGI compiler - they don't work and shouldn't be needed.
Removed local declaration of icase, when class member should do.


[SVN r19085]
2003-07-12 10:33:10 +00:00
cb9409160a Moved static stables into the function bodies to fix a gcc on MacOS X and IMB compiler bug.
Fixed config system for dll builds - the default linkage option is now static linking.
Fixed makefiles - dll builds now work.
Added Misc fixes for the example programs.


[SVN r19044]
2003-07-11 11:51:35 +00:00
c32c644a38 Added fixes for:
Compilers that pretend to be Visual C++
export of memory management code


[SVN r18955]
2003-07-07 11:44:00 +00:00
5c0a6398ab Updated link in docs
[SVN r18948]
2003-07-06 10:51:00 +00:00
4a851cf958 Fixed C++ Builder 5 support,
Fixed support for bidirectional iterators,
Fixed enum declaration in states.hpp.


[SVN r18874]
2003-06-27 11:12:47 +00:00
6f9ba7a289 Added new concept check,
removed assertion in degug allocator that was being triggered by std lib code !


[SVN r18873]
2003-06-27 11:11:21 +00:00
4a06f15183 Added missing needed include
[SVN r18863]
2003-06-24 10:52:51 +00:00
01a3b56f8a removed some previous attempted workarounds - they don't work.
[SVN r18855]
2003-06-23 11:02:00 +00:00
3fc6433d44 Updated performance figures for GRETA.
[SVN r18822]
2003-06-17 10:30:08 +00:00
5255c45b0a Fixed bug in token_iterator that caused it to miss items when field splitting.
[SVN r18821]
2003-06-17 10:28:51 +00:00
ed48905c5e Added check for invalid regular expression in matching code.
[SVN r18777]
2003-06-11 12:11:17 +00:00
13769e4fff Fixed array bounds so that gcc3 will actually compile the code, it's now seriously unmainable though, still it's the only thing that seems to work...
[SVN r18761]
2003-06-10 11:59:44 +00:00
6dfa7ef86c Added explicit bounds to arrays, as patch for broken compilers that can't otherwise cope.
[SVN r18743]
2003-06-09 11:56:15 +00:00
eb91bf612a Fixed allocator type.
[SVN r18680]
2003-06-05 11:56:59 +00:00
e016ef8e21 Added minor bug fixes (some expressions starting with ^ were not being found), plus a few warning suppressions.
[SVN r18679]
2003-06-05 10:46:03 +00:00
ca984697f0 Add <no-warn> so como can compile winnt.h
[SVN r18656]
2003-06-03 20:07:02 +00:00
2f9da388c1 Added fix for IBM C++
[SVN r18586]
2003-05-28 11:38:00 +00:00
f50f35d1fc Added <ios> include for KCC
[SVN r18536]
2003-05-25 11:16:14 +00:00
df4b8e696f Added patch for gcc 2.95 and get_line under cygwin
[SVN r18535]
2003-05-25 10:58:24 +00:00
3673a0a888 Added support for BOOST_DEDUCED_TYPENAME
[SVN r18534]
2003-05-25 10:54:03 +00:00
a69678c3c6 stripped tabs from files
[SVN r18526]
2003-05-24 11:14:53 +00:00
8fb69853fc Fixed broken links, added copyright declarations, renamed some long file names
[SVN r18525]
2003-05-24 11:13:26 +00:00
70199360d3 Use the recently added BOOST_INTEL macro
[SVN r18511]
2003-05-23 11:53:49 +00:00
9aa18a159d Added como warning suppression.
[SVN r18508]
2003-05-23 11:31:00 +00:00
4122e8f08d Fixed VC warning
[SVN r18506]
2003-05-23 10:57:04 +00:00
922322b644 Updated install docs.
[SVN r18494]
2003-05-22 11:20:26 +00:00
89d445c1b6 Tweaked dll selection code,
Fixed various errors detected by MWCW and Como


[SVN r18493]
2003-05-22 11:19:58 +00:00
31d1dc1182 Removed external templates for unknown compilers.
Fixed std conformance bugs in v4 code (shown up by metrowerks compiler).


[SVN r18467]
2003-05-20 11:28:47 +00:00
8bb6861595 Updated Jamfile to use simplified naming scheme on Unix platforms.
Updated build docs.


[SVN r18466]
2003-05-20 11:27:29 +00:00
11ddff601b Added new makefile
[SVN r18444]
2003-05-19 11:57:32 +00:00
088b492987 changed lib names, minor gcc3.3 warning patches
[SVN r18443]
2003-05-19 11:56:17 +00:00
535e1b05cc Updated library names, minor fixes for gcc2.95
[SVN r18442]
2003-05-19 11:55:23 +00:00
1f15026060 Merged regex-4 branch.
[SVN r18431]
2003-05-17 11:55:51 +00:00
f0f32bdda1 Merged regex-4 branch.
[SVN r18430]
2003-05-17 11:45:48 +00:00
a81a1ea30f restore from disk crash
[SVN r18353]
2003-05-08 02:19:10 +00:00
640f633395 Patched boost-base.jam to allow rules in stage target requirements
Fixed grammar in build_system.htm
Added vc7.1-tools.jam/.html for msvc 7.1
Updated the regex lib Jamfile to build correctly-named libraries


[SVN r18319]
2003-04-27 14:10:52 +00:00
0ed72c37e4 Fixed nasty typo
[SVN r18133]
2003-03-30 10:30:16 +00:00
5cf85df857 Changed name of getlocale proc to avoid HP OS clash.
[SVN r18079]
2003-03-25 11:43:57 +00:00
3819294ac1 Added check to verify that we have something to clean up before calling do_free
[SVN r18075]
2003-03-24 12:36:55 +00:00
ea96eafacc Fixed bug that effect some searches
[SVN r18003]
2003-03-19 12:19:14 +00:00
a31ae14cf8 added extra tests to test new fixes
[SVN r17891]
2003-03-13 13:45:44 +00:00
158c26d85c Misc. new fixes:
Better support for BOOST_NO_WREGEX
Fixed bug in trailing null backrefs
Fixed bug in null repeat code
Fixed bug in negative forward lookahead assert when used as a prefix.


[SVN r17889]
2003-03-13 12:50:54 +00:00
86e5251979 Fix for broken std::setlocale implementations (MacOS X ?)
[SVN r17575]
2003-02-21 12:43:49 +00:00
cebaf09b5d cleanup
[SVN r17531]
2003-02-19 13:56:27 +00:00
d0ba00a2e7 Fixed bug in match_continuous code
[SVN r17276]
2003-02-08 12:30:57 +00:00
75293e9854 Fixed by adding BOOST_REGEX_NO_EXTERNAL_TEMPLATES define and extra error checks.
[SVN r17264]
2003-02-07 12:16:40 +00:00
45e593c4fe Added copyright statement
[SVN r17196]
2003-02-04 12:24:06 +00:00
251099c828 OpenBSD fixes
[SVN r16990]
2003-01-22 12:38:54 +00:00
5705d52e84 Added threading build options.
[SVN r16972]
2003-01-21 12:21:35 +00:00
88a0f9d75a Added multithreaded build options.
[SVN r16971]
2003-01-21 12:20:20 +00:00
fbb087dec9 fix misspelled dir name
[SVN r16948]
2003-01-19 20:21:36 +00:00
c84ebf1c5b Update V2 Jamfile for Boost.
[SVN r16882]
2003-01-13 10:05:01 +00:00
1eec12f177 Modified regression program arguments, so they work when called from some other path.
[SVN r16877]
2003-01-12 12:29:49 +00:00
82ad27c468 Modified Jamfile to use testing.jam
[SVN r16868]
2003-01-11 11:52:19 +00:00
897c33be2a Updated test lib names
[SVN r16714]
2002-12-28 12:51:48 +00:00
2ecd905fb2 add or update See www.boost.org comments
[SVN r16708]
2002-12-27 16:51:53 +00:00
abef9c7249 removed calls to wprintf: Linux doesn't have that API.
removed calls to assert: MWCW can't cope with it when UNICODE is defined.


[SVN r16392]
2002-11-24 11:48:36 +00:00
0e37a76df0 Fix for MWCW which doesn't like incomplete array type.
[SVN r16375]
2002-11-23 11:30:36 +00:00
adc4ee41e3 Fixed using declarations (some types are no longer in the library).
[SVN r16340]
2002-11-20 12:08:43 +00:00
9a4e5d29c1 tentative fix for VC7
[SVN r16252]
2002-11-15 11:50:41 +00:00
ff4890b2e2 Changed detail/ to v3/ in dependency list.
[SVN r16194]
2002-11-11 12:15:04 +00:00
3a5f4775f7 changed boost/regex/detail to boost/regex/v3
[SVN r16185]
2002-11-10 11:37:08 +00:00
5a65397974 Changed boost/regex/detail to boost/regex/v3
[SVN r16184]
2002-11-10 11:35:53 +00:00
e5d9c95456 Fixed header include after recent changes
[SVN r16159]
2002-11-08 11:55:49 +00:00
b6a13dd215 Added check for BOOST_NO_STD_DISTANCE
[SVN r16144]
2002-11-07 12:59:57 +00:00
cf285ed3e5 Changes made in preparation for new regex version.
[SVN r16141]
2002-11-07 12:50:29 +00:00
66ddab7fae Fixes for Intel C++
[SVN r16029]
2002-10-31 12:13:56 +00:00
09bfc7f853 Merged changes from the RC_1_29_0 branch.
[SVN r15959]
2002-10-21 11:03:05 +00:00
13df8a293b Add missing typename
[SVN r15905]
2002-10-11 20:46:12 +00:00
40ab965ee9 Added V2 Jamfile.
[SVN r15778]
2002-10-07 16:45:38 +00:00
0fec291b28 changes to use boost test system
[SVN r15403]
2002-09-17 10:58:25 +00:00
6ee955be5f Tweeked number of states that cause a throw to occur during search.
[SVN r15402]
2002-09-17 10:57:26 +00:00
eeae9a0762 Added try catch block to catch runtime errors thrown from matching algorithms
[SVN r15374]
2002-09-16 11:55:23 +00:00
c7c8400efa VACPP fix
[SVN r15373]
2002-09-16 11:54:41 +00:00
a7f8f56d92 Added throw if the number of searched states grows too large.
[SVN r15372]
2002-09-16 11:54:00 +00:00
66ac67533c VACPP fixes (second try)
[SVN r15371]
2002-09-16 11:53:07 +00:00
d9694bbc1f Fixed regex makefiles to work nice with the new boost.test lib.
Added tentative VACPP fix.


[SVN r15300]
2002-09-13 11:52:11 +00:00
f81bdae7f1 Fixed forward declarations, added tentative IBM C++ fix
[SVN r15298]
2002-09-13 11:41:21 +00:00
aebf86bbe5 removed MSVC warning suppression - it causes the compiler to ICE under some conditions
[SVN r15195]
2002-09-07 10:47:06 +00:00
de9ecb7407 Fixed MSVC warnings
[SVN r15140]
2002-09-03 10:14:30 +00:00
fa43c7ab1d Misc Kylix fixes
[SVN r15086]
2002-08-25 11:57:37 +00:00
5f0f6fa8f1 Updated Jamfile to use new test suite.
Updated docs to reflect recent changes.


[SVN r15081]
2002-08-24 11:57:10 +00:00
81f404ec69 Disabled automatic lib selection on non-windows platforms for Borland
[SVN r15080]
2002-08-24 11:56:11 +00:00
38b55d0db8 Added missing break statements
[SVN r15078]
2002-08-24 11:25:01 +00:00
bed785ad19 Added GCC warning suppression
[SVN r15022]
2002-08-21 11:05:30 +00:00
bb711db956 Added new state information for forthcomming new algorithms
[SVN r14889]
2002-08-15 11:30:08 +00:00
13f9af564d Added some new state information for forthcomming new algorithms.
[SVN r14808]
2002-08-13 11:47:41 +00:00
43cf48f61e Boost.Test V2 fix
[SVN r14787]
2002-08-12 14:23:28 +00:00
2767f7f6ba Tentative MWCW fixes
[SVN r14662]
2002-08-02 11:59:22 +00:00
035e752ed2 Added minor doc fixes
[SVN r14653]
2002-07-31 11:24:41 +00:00
753a3d6584 Removed duplicate declaration.
[SVN r14635]
2002-07-29 11:04:14 +00:00
ab0051399e Added como and metrowerks to list of compilers that can't handle the template specialisations used in instances.hpp.
[SVN r14624]
2002-07-27 11:42:04 +00:00
61ea1b566a Added workaround for gcc2.91 bug
[SVN r14513]
2002-07-18 11:07:46 +00:00
1ad6328d33 Added BOOST_NO_STD_WSTREAMBUF guard
[SVN r14491]
2002-07-17 11:39:15 +00:00
e6a371c6d6 Added MSVC version check.
[SVN r14475]
2002-07-16 11:15:30 +00:00
ee59983ea9 Oops, messed up previous commit.
[SVN r14445]
2002-07-14 10:56:58 +00:00
ad769fcfdb Added needed Como options
[SVN r14432]
2002-07-13 10:58:11 +00:00
2468d450f2 Added -Ve and -Vx options to bcb makefiles.
[SVN r14319]
2002-07-07 10:28:32 +00:00
d47f20f147 Added | to the list of characters that are not literals.
[SVN r14139]
2002-06-13 11:27:56 +00:00
0575e50ddb Changed template function overload to wchar_t overload.
[SVN r14138]
2002-06-13 10:30:46 +00:00
de40dac5d1 Fixed test program after changes to regex_match code.
[SVN r14111]
2002-06-08 10:37:47 +00:00
b2c4abc9cf Fixed partial match bug:
The following program demonstrates what we believe is a bug in regex partial
match algorithm:

    int main()
    {
    //  boost::regex const re("(ab)?c"); // ok
        boost::regex const re("(ab)?"); // fails in the assert below

        boost::cmatch what;
        assert(boost::regex_match( "a", what, re, boost::match_default |
boost::match_partial ));
    }


[SVN r14110]
2002-06-08 10:36:54 +00:00
b856079e74 Added C++ Builder 6 binary compatibilty fixes,
Updated gcc makefiles to build archive index.


[SVN r14088]
2002-06-06 11:33:46 +00:00
293b945785 Added fixes for C++ Builder 6 alignment (binary compatibility) issues.
[SVN r14087]
2002-06-06 11:32:45 +00:00
998f94ffe9 vc7 warning suppression.
[SVN r14064]
2002-05-30 11:07:55 +00:00
53de3c4ae6 Fixed more warnings, rolled back some regex changes that seem to be causing problems on 64-bit platforms.
[SVN r14063]
2002-05-30 11:07:05 +00:00
bbbd65c2e4 Hopefully fixed some minor bugs:
added missing typesnames.
	Changed iterator to Iterator to hopefully keep aCC happy.


[SVN r14020]
2002-05-23 11:43:27 +00:00
129cf61f65 respect <sysinclude>
[SVN r13995]
2002-05-21 16:24:07 +00:00
992eb043af Config updates/patches
[SVN r13973]
2002-05-18 11:33:30 +00:00
084af757b4 Misc. fixes and new config options.
[SVN r13971]
2002-05-18 11:30:49 +00:00
1035f25b65 Disabled template specialisations on AIX with IBM Visual Age
[SVN r13850]
2002-05-14 10:44:21 +00:00
eacf31772b Fixed Mingw32 build
[SVN r13804]
2002-05-10 11:37:32 +00:00
8d8a209d8b Added user-config macro BOOST_DISABLE_WIN32
(also set in the compiler 's strict mode).
Modified Boost source not to use Win32 specific
extentions in the presence of BOOST_DISABLE_WIN32.


[SVN r13771]
2002-05-09 11:40:52 +00:00
6b75e3962d Fixed test programs (disabled separate file template instantiation for single file builds).
[SVN r13661]
2002-05-04 11:00:48 +00:00
1826080071 Fixed erroneous functio signature
[SVN r13660]
2002-05-04 10:55:51 +00:00
2ee6dec715 Fixed broken links.
[SVN r13574]
2002-04-27 11:05:49 +00:00
298651b2f6 Turned off external templates for MWCW
[SVN r13573]
2002-04-27 10:45:12 +00:00
752c43f9d4 Bug fix: changed int to std::ptrdiff_t
[SVN r13572]
2002-04-27 10:38:47 +00:00
976fb02a1b Moved some key template instances into the lib and out of user code.
Updated makefiles:
	renamed lib files with new more systematic naming convention.
	Added bcb6 support.
	Rewritten automatic lib selection.
Updated copyright declarations.


[SVN r13557]
2002-04-24 10:50:23 +00:00
d67a843d5a add newline at end of file
[SVN r13553]
2002-04-23 19:51:36 +00:00
3e3752e992 Added BOOST_NO_WREGEX guard.
[SVN r13357]
2002-04-03 11:04:46 +00:00
7c42b3aca6 Moved is_combining inside BOOST_NO_WREGEX guard.
[SVN r13356]
2002-04-03 11:03:13 +00:00
bb89bbb29a Added regex_fwd.hpp support.
[SVN r13334]
2002-04-01 11:47:30 +00:00
2035a49533 Added support for regex_fwd.hpp
[SVN r13333]
2002-04-01 11:46:04 +00:00
6e82619133 Added needed #ifdef
[SVN r13295]
2002-03-28 12:47:47 +00:00
1d560fae85 Minor doc typo fixes.
Fixed IA64 portability warnings from VC7


[SVN r13225]
2002-03-19 11:31:52 +00:00
b4cf815f7d Fixed IA64 compatibility warnings from VC7, mainly changed unsigned int's to size_t and int's to ptrdiff_t.
[SVN r13223]
2002-03-19 11:29:50 +00:00
1d3653812a Fixed broken link.
[SVN r12993]
2002-03-01 12:26:01 +00:00
9ef4719dff Modified jamfiles to work with new updated build system
[SVN r12952]
2002-02-27 12:37:28 +00:00
e18c474222 Updated regression tests with more non-marking parenthesis examples
[SVN r12912]
2002-02-23 12:58:45 +00:00
7f6be58d92 Fixed Borland C++ config workarounds - so that _RWSTD_COMPILE_INSTANTIATE gets defined before any std lib includes
[SVN r12871]
2002-02-21 11:31:48 +00:00
11accf4a8b Added more error checking for no-eh builds.
[SVN r12870]
2002-02-21 11:30:41 +00:00
b55cce9a42 Fixed behaviour on Embedded VC++
[SVN r12868]
2002-02-20 11:20:17 +00:00
6f9658fa6c Fixed VCL setup to come before lib selection
[SVN r12847]
2002-02-17 12:05:59 +00:00
936e0cfd99 Added note about Koenig Lookup required for examples to compile
[SVN r12802]
2002-02-14 12:56:37 +00:00
290270440e Updated the basic Jamfiles for the new Boost.Build changes.
[SVN r12798]
2002-02-14 04:08:20 +00:00
76c85c7c34 Fixed regex example expression typo.
[SVN r12792]
2002-02-13 12:30:22 +00:00
44d33b20d5 Can't declare a variable in a for-loop with the same name as a variable declared in the for loop initialization
[SVN r12775]
2002-02-09 16:37:56 +00:00
98377b57aa Strange workaround for Comeau 4.2.45.2 so that it does get into an
instantiation loop


[SVN r12773]
2002-02-09 15:49:04 +00:00
43df21bca1 Fixed incorrect iterator use - assumed random access iterator in one place rather than bidirectional.
[SVN r12768]
2002-02-09 12:07:53 +00:00
c8e9df8fa2 Added support for compilers with no exception handling support.
[SVN r12758]
2002-02-08 12:44:43 +00:00
a5d1526fbb Added docs for forward lookahead asserts.
[SVN r12757]
2002-02-08 12:43:59 +00:00
f79497c625 Handle standard libraries that do not support std::iterator
[SVN r12686]
2002-02-04 12:54:17 +00:00
a108657449 Make string_out_iterator a full-fledged output iterator
[SVN r12671]
2002-02-03 17:30:13 +00:00
9225fa8531 Removed unnecessary template parameter from ostream_iterator so that it works with gcc2.9x now.
[SVN r12666]
2002-02-03 11:44:37 +00:00
07c20c1926 Modified code that determines how long to loop for, with upper limit of 1s.
[SVN r12665]
2002-02-03 11:43:23 +00:00
d227059666 New smart pointer documentation. Related clean-up of the smart pointer
library. Changing includes to include the new individual smart pointer
headers. Replacing old smart pointer library with an include of the new
smart pointer headers. Simplify ifdefs that involve the member templates
macros now that BOOST_MSVC6_MEMBER_TEMPLATES is also guaranteed to bet
set for platforms that have full member templates.


[SVN r12647]
2002-02-02 18:36:12 +00:00
f5082341c0 changed all pointer casts to explicit static_cast or reinterpret_cast.
Added more tests for forward lookahead asserts.


[SVN r12575]
2002-01-30 12:17:51 +00:00
5613d77433 Changed all pointer casts to either static_cast or reinterpret_cast as appropriate.
[SVN r12574]
2002-01-30 12:16:28 +00:00
6463dcfb07 regex_timer.cpp:
- Head off some infinite looping on some platforms


[SVN r12550]
2002-01-29 13:38:30 +00:00
c07c4e0a11 Added support for forward lookahead asserts.
[SVN r12455]
2002-01-23 12:42:31 +00:00
e993619390 Stripped tabs from source
[SVN r12351]
2002-01-19 12:38:14 +00:00
e22aaa9d20 Fixed copy self assignment bug
[SVN r12248]
2002-01-08 13:00:08 +00:00
52dbd281ca Added checks to message loading code.
Added extra members to RegEx class.
Updated docs accordingly.


[SVN r12244]
2002-01-07 13:03:50 +00:00
e4138b5bdc Added members RegEx::Match and RegEx::npos.
[SVN r12243]
2002-01-07 13:02:37 +00:00
534f6273c0 No longer throws on copy-construct
asserts when applying fixups (invariant checks) added


[SVN r12242]
2002-01-07 13:01:31 +00:00
b2dd7877da Updated regex examples and Jamfiles so that they are run as tests.
[SVN r12149]
2001-12-26 11:21:24 +00:00
0cda8c8a2e Initial checkin
[SVN r12122]
2001-12-19 11:57:20 +00:00
04282b5d0a Updated version numbers in docs.
[SVN r12081]
2001-12-17 12:44:26 +00:00
554832217c Updated regex examples and Jamfiles so that most now run as tests.
[SVN r12067]
2001-12-16 11:33:27 +00:00
63130c1ef5 Updated Jamfiles and tests so that they actually work now!
[SVN r11985]
2001-12-09 12:50:46 +00:00
edbc68df6c Updated to reflect changes in STLport-4.5
[SVN r11970]
2001-12-07 12:14:56 +00:00
372a07902e Made string_compare functions inline (they should have been all along).
[SVN r11952]
2001-12-06 12:39:31 +00:00
4ae95dae74 removed unneeded #if block
[SVN r11906]
2001-12-04 12:23:28 +00:00
277ca851c8 Metrowerks needs BOOST_NO_STD_LOCALE in config to be able to compile regex
regex test Jamfile updates so that some tests will actually run
warning suppression for condition.cpp

unit-test rule now accepts input files
updated metrowerks and borland to properly set up path for running tests

----------------------------------------------------------------------
Modified Files:
	boost/config/compiler/metrowerks.hpp
	libs/python/src/gen_function.py libs/regex/test/Jamfile
 Tag: thread-initial
	libs/thread/src/condition.cpp
 No tag
	tools/build/boost-base.jam tools/build/borland-tools.jam
	tools/build/metrowerks-tools.jam
----------------------------------------------------------------------


[SVN r11853]
2001-12-02 17:43:45 +00:00
f0d62fb2c0 Updated changes log
[SVN r11830]
2001-11-30 12:00:31 +00:00
7104418bd5 * Changed BOOST_RE_THREADS to BOOST_HAS_THREADS,
* Updated allocator code to use SGI node based allocator when available.


[SVN r11829]
2001-11-30 11:58:04 +00:00
0bd54d3821 Added optional code to time how long the test takes.
[SVN r11828]
2001-11-30 11:56:35 +00:00
c167b1f183 changed BOOST_RE_THREADS to BOOST_HAS_THREADS
[SVN r11827]
2001-11-30 11:56:02 +00:00
52920ff98f Added \ as a non-literal character (oversight).
[SVN r11717]
2001-11-16 12:25:17 +00:00
72c3b4ed13 Fix for broken split (doesn't spit out all sub expressions).
[SVN r11716]
2001-11-16 12:24:40 +00:00
6cc5cf41d5 Trivial fix for signed/unsigned comparison
[SVN r11715]
2001-11-16 12:24:01 +00:00
a7984bb149 Updated Jamfiles with forced dynamic linking removed.
[SVN r11647]
2001-11-10 12:12:38 +00:00
876ff39307 remove redundant <runtime-link>dynamic from default-BUILD section
[SVN r11644]
2001-11-09 15:30:45 +00:00
79f80ad09d Updated list of helpers
[SVN r11449]
2001-10-26 11:58:59 +00:00
19d8e96cf5 Added workaround for Rogue Wave lib bug.
[SVN r11391]
2001-10-16 11:36:47 +00:00
e047b2b509 Updated examples with better comment on expressions. Updated test program to test for apparent Rogur Wave bug (and it's workaround).
[SVN r11390]
2001-10-16 11:36:00 +00:00
28968bd2b6 renamed "free" member functions to avoid conflicts with system macros.
[SVN r11384]
2001-10-13 10:26:34 +00:00
c4b295684b Added docs for smatch and wsmatch typedefs, added warnings about using temporaries with regex_search/regex_match.
[SVN r11383]
2001-10-13 10:24:55 +00:00
33b6eb0637 Renamed member functions "free" to prevent conflict with system macro.
[SVN r11380]
2001-10-13 10:19:01 +00:00
de9ad8df74 Fix spelling error: "occurances" -> "occurrences".
[SVN r11376]
2001-10-11 17:26:04 +00:00
a042a0b6de Removed spurious MSVC pragma
[SVN r11369]
2001-10-09 11:25:43 +00:00
f16f300347 Fixed inclusion of windows.h
[SVN r11356]
2001-10-08 11:32:22 +00:00
a543dce5e3 regex, threads, and python will all build from the top level. If you build the 'test' target from the top level, it will run all regressions.
Jamfile:
  subincludes for thread, python libs, and status for regression tests

Jamrules:
  Use the new path-global rule to establish BOOST_ROOT correctly for all subprojects

libs/regex/build/Jamfile
  Take advantage of correct BOOST_ROOT setting

libs/python/build/Jamfile
  Search for python executable; don't try to build anything if it can't be found.
  don't build tests by default
  improved comments, organization, and naming.

status/Jamfile
  Fixed references to config test files
  Failed tests now leave their stdout results in <testname>.error instead of removing it
  No test targets are dependencies of 'all' anymore
  Added comments
  Reorganized

tools/build/Jambase
  Meant to check this in long ago.

tools/build/allyourbase.jam
  Fixed SHELL_EXPORT setting, added SHELL_SET
  removed 'test' from the dependencies of 'all'; tests no longer run by default.
  Fixed the direction of slashes for Windows when ALL_LOCATE_TARGET is used.
  Added path-global rule for declaring path variables which may be relative
  rule in-invocation-subdir returns true if the current subproject is the one
     from which Jam was invoked
  rule protect-subdir is now used to protect subproject variables
  rule tokens-to-simple-path converts path tokens to a simplified path.

tools/build/boost-base.jam
  Fixed bugs

tools/build/jam_src/makedebugjam.bat
  Fixed a bug which prevented a final debug build

tools/build/jam_src/search.c
  Fixed a bug of mine which caused LOCATE to be ignored (!).


[SVN r11348]
2001-10-06 18:19:15 +00:00
fe45d5bf4a Tweeked regex version number to reference <boost/version.hpp>
[SVN r11309]
2001-09-30 10:30:14 +00:00
4dd87c299f Fixed iterator definition
[SVN r11299]
2001-09-28 11:33:25 +00:00
3d3f591516 Fixed partial ordering macro names
[SVN r11298]
2001-09-28 11:08:33 +00:00
5b5d4c3145 Fixed typo - \f is \x0C not \x08
[SVN r11297]
2001-09-28 11:07:41 +00:00
1c45c7a48d updated makefiles to generate error if MSVCDIR not set
[SVN r11296]
2001-09-28 11:06:57 +00:00
4922ae784f Fixed messed up c_regex_traits from previous commit, fixed Koenig lookup bug caused by presence of boost::re_detail::destroy
[SVN r11249]
2001-09-25 11:48:21 +00:00
007c0da3b2 Add a workaround for platforms where <ctype.h> has macros only.
[SVN r11235]
2001-09-24 19:34:15 +00:00
3fb0375da4 Another attempt to fix the WinXP character class problems
[SVN r11216]
2001-09-23 12:02:28 +00:00
0cef054b31 change missed occasion of BOOST_RE_NO_SWPRINTF -> BOOST_NO_SWPRINTF
[SVN r11205]
2001-09-22 15:24:10 +00:00
7218f9847a fix typo: omission of parameter names
[SVN r11203]
2001-09-22 14:53:00 +00:00
2bc1f9c998 More fixes resulting from the new config
[SVN r11182]
2001-09-21 11:35:54 +00:00
9edaddab6f Updated docs to match new config
[SVN r11181]
2001-09-21 10:35:16 +00:00
1647dd908e Added missing typename qualifier
[SVN r11165]
2001-09-20 11:45:48 +00:00
187208adf5 First round of config fixes
[SVN r11146]
2001-09-19 11:48:51 +00:00
30e9920147 remove stray \r
[SVN r11143]
2001-09-18 21:53:41 +00:00
1d473147fd commit of split-config, including any changes required to existing libraries (mainly regex).
[SVN r11138]
2001-09-18 11:13:39 +00:00
1be8e9241b Previous update broke non-win32 support, now fixed.
[SVN r11094]
2001-09-11 11:06:44 +00:00
e60414a5e7 Added regression tests
[SVN r11072]
2001-09-08 12:04:25 +00:00
7bd8e2a14d Fixed to work with _UNICODE on Win32
[SVN r11071]
2001-09-08 12:03:55 +00:00
b2396011f9 Fixed path to work from root directory
[SVN r11070]
2001-09-08 12:02:47 +00:00
b9628e449d Fixed do that code compiles on Win32 with _UNICODE defined
[SVN r11069]
2001-09-08 12:01:30 +00:00
139a2f60fb Updated build system (more or less works now)
[SVN r10890]
2001-08-18 11:50:48 +00:00
a4912a834e Fixed initialisation order warnings (gcc)
[SVN r10887]
2001-08-18 10:22:53 +00:00
014b66b2f4 Removed non-functioning msvc link command from Jamfile, added user32.lib forced link to w32_regex_traits.cpp
[SVN r10886]
2001-08-18 10:22:10 +00:00
b2ea26705d Added (as yet non-functional msvc library support)
[SVN r10876]
2001-08-16 11:43:22 +00:00
432f59cde7 Updated Jamfile (it works now!)
[SVN r10850]
2001-08-13 11:34:37 +00:00
846da064e0 Added Jamfile
[SVN r10843]
2001-08-12 11:55:51 +00:00
88a6779e8b Fixed WinXP problems
[SVN r10842]
2001-08-11 11:50:34 +00:00
5749937f26 Fixed some WinXP problems
[SVN r10841]
2001-08-11 11:49:19 +00:00
e1492c79ce updated jamfile, fixed Windows XP problems
[SVN r10840]
2001-08-11 11:47:12 +00:00
a06c964cab Spell things consistently. Add some bits of Mac stuff to the tests.
Use std::size_t where needed.


[SVN r10800]
2001-08-07 17:22:02 +00:00
77f76889f8 Minor purify error fixes
[SVN r10713]
2001-07-28 11:23:09 +00:00
50c4d1e6ca Fixed some purify errors (unitialised reads)
[SVN r10712]
2001-07-28 11:22:28 +00:00
7079ba0424 tweeked docs - added credits + iterator categories.
[SVN r10701]
2001-07-25 10:20:47 +00:00
e7b8b5712d Fixed nasty bug, where some invalid expressions caused access violations.
[SVN r10688]
2001-07-22 10:26:54 +00:00
f5f309be54 Initial checkin. Needs tweaks for various compilers.
[SVN r10683]
2001-07-21 13:06:09 +00:00
890dc95e0d fixed relative link
[SVN r10610]
2001-07-14 10:54:55 +00:00
517d3e9256 Change absolute URL's to relative
[SVN r10594]
2001-07-12 15:31:15 +00:00
9bbca4613c Fix bad patch I sent to John that makes Metrowerks compiles fail.
[SVN r10521]
2001-07-03 21:43:51 +00:00
01575dccbd Added some missing std:: prefixes and fixed Metroworks 7 support
[SVN r10464]
2001-06-28 11:45:22 +00:00
3045723a54 Added std:: prefix to some size_t's
[SVN r10463]
2001-06-28 11:44:36 +00:00
2fd9ef66cc Fixed non-standard usage of mbtowcs (added std:: prefix).
[SVN r10421]
2001-06-25 11:29:47 +00:00
56447e1443 Added LC_MESSAGES workaround
[SVN r10420]
2001-06-25 11:29:00 +00:00
d36070e4cd Added dec alpha fix for missing LC_MESSAGES category
[SVN r10418]
2001-06-25 11:26:20 +00:00
4f1b0d09b3 Fixed minor typos
[SVN r10312]
2001-06-12 11:26:48 +00:00
1acfee5702 Updated for intel compiler support
[SVN r10304]
2001-06-10 11:06:12 +00:00
330d46f306 regex point release (minor compatiblity fixes)
[SVN r10245]
2001-05-30 11:36:49 +00:00
60659c5d84 Added BeOS threading support, tweeked STLPort detection.
[SVN r10235]
2001-05-28 11:48:06 +00:00
1444ac208f minor cygwin config fix
[SVN r10234]
2001-05-27 11:08:48 +00:00
c0a8361373 Fixed purify warings about access to unitialised memory
[SVN r10232]
2001-05-26 11:58:19 +00:00
0ef48255a7 Fixed problems that occur when regex has invalid or unititalised expression.
[SVN r10231]
2001-05-26 11:57:25 +00:00
bfb3ccc907 regex: fixed iterator definition so that it passes the SGI/boost concept checks.
[SVN r10214]
2001-05-24 10:35:34 +00:00
04b11fdd1c Added support for "format_first_only" new format flag
[SVN r10119]
2001-05-17 11:55:55 +00:00
f466b2ad2a Minor regex config changes, fixed KMP search code.
[SVN r10115]
2001-05-15 12:00:33 +00:00
f913683002 Fixed some issues with calling conventions for Borland/Microsoft compilers
[SVN r10114]
2001-05-15 11:00:01 +00:00
a58bf0705d Added missing BOOST_RE_CALL declarators to c_regex_traits
tweeked BOOST_RE_CALL definition


[SVN r10100]
2001-05-12 10:41:19 +00:00
f6fd177e2a Added missing BOOST_RE_CALL modifier
[SVN r10091]
2001-05-11 11:30:32 +00:00
9f051ee667 Added some missing BOOST_RE_CALL macros
[SVN r10090]
2001-05-11 11:28:11 +00:00
08cee9a2a6 Fixes for STLPort 4.1b6,
and for gcc on platforms with <sys/type.h>


[SVN r10089]
2001-05-11 10:50:06 +00:00
efd0ce56bc reorganised regex config setup
[SVN r10064]
2001-05-08 11:24:35 +00:00
fb81ff65fc Updated Faq and acknowledgements
[SVN r10006]
2001-05-03 10:53:58 +00:00
774c7ec4d5 Fixed RegEx::Length, Fixed Borland config
[SVN r9991]
2001-04-28 12:03:05 +00:00
19dab6c60a tweeked borland makefiles for case sensitive linking, changed memcpy to memmove in partial grep example
[SVN r9990]
2001-04-28 10:12:52 +00:00
a719c77f63 Fixes resulting from changed directory structure
[SVN r9987]
2001-04-27 11:06:28 +00:00
33a84ba374 Updated docs on match_results::size()
[SVN r9838]
2001-04-19 11:27:23 +00:00
8d9bce7c33 Fixed Codeguard warnings
[SVN r9837]
2001-04-19 10:54:01 +00:00
a92faf9d3d regex point release
[SVN r9834]
2001-04-18 11:35:32 +00:00
ab16e6c6c0 updated regex directory structure
[SVN r9765]
2001-04-12 11:14:59 +00:00
ed21a5183b reworked regex directory structure to match boost requirements.
[SVN r9752]
2001-04-10 11:44:47 +00:00
dcb64d5db7 Fixed VC6.sp5 support, added support for mixed static/dynamic linking with VC6
[SVN r9744]
2001-04-09 11:19:12 +00:00
42ba37691e Updated makefiles, added sunpro makefile support
[SVN r9743]
2001-04-09 11:17:40 +00:00
020cbe902e regex: Fixed spurious matches when grepping with .*
[SVN r9686]
2001-03-31 11:24:27 +00:00
fac0fa6653 Minor config tweek for gcc libstdc++3
[SVN r9643]
2001-03-27 10:51:14 +00:00
b8adb4df00 regex updates: compatability fixes for Como and sunpro compilers
[SVN r9642]
2001-03-26 11:09:49 +00:00
1758679bd6 regex: minor changes to make the test code more conservative in C++ usage
[SVN r9563]
2001-03-16 12:41:36 +00:00
98fd29d60c updating regex configure (should have been in previous fix)
[SVN r9556]
2001-03-14 12:54:48 +00:00
26ccffe3d0 Misc regex fixes: removed BOOST_RE_NO_EXCEPTION_H macro (no longer needed), added hack for VC6+STLPort regression test (missing wstring exports in STLPort dll).
[SVN r9555]
2001-03-14 12:52:06 +00:00
f5368b7666 Fixed header include: should have included <boost/type_traits/cv_traits.hpp>
[SVN r9537]
2001-03-10 11:24:11 +00:00
c126ed4b87 regex: tweeked type_traits usage to reduce header dependencies
[SVN r9519]
2001-03-09 11:51:44 +00:00
9e6a7d8e5f More regex makefile updates (changed name to libboost_regex)
[SVN r9486]
2001-03-08 12:29:07 +00:00
15142ddf9d Misc fixes that missed the last commit..
[SVN r9402]
2001-03-04 11:08:29 +00:00
831160baa2 makefile adjustments
[SVN r9396]
2001-03-03 11:37:50 +00:00
db6b4db44d updated makefile responds to environment
[SVN r9395]
2001-03-03 11:35:37 +00:00
f414a067b8 regex doc updates for partial matches and revised makefiles
[SVN r9394]
2001-03-03 11:32:04 +00:00
833740c25b regex makefile updates: better responce to environment variables, and correct linker options for gcc-shared.mak
[SVN r9393]
2001-03-03 11:31:04 +00:00
ee8c9873bc Updates for better partial match support, and to ensure that that the POSIX API functions are able to return the correct error code.
[SVN r9392]
2001-03-03 11:28:50 +00:00
efdf9e57a4 More type_traits tweeks.
[SVN r9287]
2001-02-20 12:17:55 +00:00
2609a56230 fixed some typo's
[SVN r9284]
2001-02-20 02:28:15 +00:00
24dd51c869 Added RegExData constructor to keep ICL compiler happy
[SVN r9272]
2001-02-19 12:57:35 +00:00
8872307cb1 regex Intel C++ fix...
[SVN r9251]
2001-02-18 12:03:08 +00:00
50610bf111 regex: added explicit #error clause to reduce error messages when wide character support is not available.
[SVN r9227]
2001-02-16 12:47:30 +00:00
25d57dbe3e Fixed minor typedef typo
[SVN r9226]
2001-02-16 12:03:48 +00:00
d754f23bcf regex configuration tweeks, and point release.
[SVN r9225]
2001-02-16 11:26:21 +00:00
973b12c5c8 regex: tentatively fixed regression on Win2000, suppressed some more warnings, and tweeked Rogue Wave library detection and configuration.
[SVN r9157]
2001-02-12 12:45:25 +00:00
4342 changed files with 110725 additions and 38902 deletions

424
.github/workflows/ci.yml vendored Normal file
View File

@ -0,0 +1,424 @@
# Copyright 2020 Evan Miller
# Copyright 2020 Matt Borland
# Distributed under the Boost Software License, Version 1.0.
# (See accompanying file LICENSE_1_0.txt or copy at http://boost.org/LICENSE_1_0.txt)
name: CI
on:
push:
branches:
- master
- develop
pull_request:
release:
types: [published, created, edited]
jobs:
ubuntu-focal:
runs-on: ubuntu-20.04
strategy:
fail-fast: false
matrix:
compiler: [ g++-9, g++-10, clang++-9, clang++-10 ]
standard: [ c++11, c++14, c++17, c++2a ]
steps:
- uses: actions/checkout@v2
with:
fetch-depth: '0'
- uses: mstachniuk/ci-skip@v1
with:
commit-filter: '[skip ci];[ci skip];[CI SKIP];[SKIP CI];***CI SKIP***;***SKIP CI***;[windows];[Windows];[WINDOWS];[apple];[Apple];[APPLE]'
commit-filter-separator: ';'
fail-fast: true
- name: Set TOOLSET
run: echo ${{ matrix.compiler }} | awk '/^g/ { print "TOOLSET=gcc" } /^clang/ { print "TOOLSET=clang" }' >> $GITHUB_ENV
- name: Add repository
run: sudo apt-add-repository -y "ppa:ubuntu-toolchain-r/test"
- name: Install packages
run: sudo apt install g++-9 g++-10 clang-9 clang-10 libicu-dev
- name: Checkout main boost
run: git clone -b develop --depth 1 https://github.com/boostorg/boost.git ../boost-root
- name: Update tools/boostdep
run: git submodule update --init tools/boostdep
working-directory: ../boost-root
- name: Copy files
run: cp -r $GITHUB_WORKSPACE/* libs/regex
working-directory: ../boost-root
- name: Install deps
run: python tools/boostdep/depinst/depinst.py -I example -g "--jobs 3" regex
working-directory: ../boost-root
- name: Bootstrap
run: ./bootstrap.sh
working-directory: ../boost-root
- name: Generate headers
run: ./b2 headers
working-directory: ../boost-root
- name: Generate user config
run: 'echo "using $TOOLSET : : ${{ matrix.compiler }} : <cxxflags>-std=${{ matrix.standard }} ;" > ~/user-config.jam'
working-directory: ../boost-root
- name: Config info install
run: ../../../b2 config_info_travis_install toolset=$TOOLSET
working-directory: ../boost-root/libs/config/test
- name: Config info
run: ./config_info_travis
working-directory: ../boost-root/libs/config/test
- name: Test
run: ../../../b2 toolset=$TOOLSET
working-directory: ../boost-root/libs/regex/test
ubuntu-bionic:
runs-on: ubuntu-18.04
strategy:
fail-fast: false
matrix:
compiler: [ g++-7, g++-8, clang++-7, clang++-8 ]
standard: [ c++11, c++14, c++17 ]
steps:
- uses: actions/checkout@v2
with:
fetch-depth: '0'
- uses: mstachniuk/ci-skip@v1
with:
commit-filter: '[skip ci];[ci skip];[CI SKIP];[SKIP CI];***CI SKIP***;***SKIP CI***;[windows];[Windows];[WINDOWS];[apple];[Apple];[APPLE]'
commit-filter-separator: ';'
fail-fast: true
- name: Set TOOLSET
run: echo ${{ matrix.compiler }} | awk '/^g/ { print "TOOLSET=gcc" } /^clang/ { print "TOOLSET=clang" }' >> $GITHUB_ENV
- name: Add repository
run: sudo apt-add-repository -y "ppa:ubuntu-toolchain-r/test"
- name: Install packages
run: sudo apt install g++-7 g++-8 clang-7 clang-8 libicu-dev
- name: Checkout main boost
run: git clone -b develop --depth 1 https://github.com/boostorg/boost.git ../boost-root
- name: Update tools/boostdep
run: git submodule update --init tools/boostdep
working-directory: ../boost-root
- name: Copy files
run: cp -r $GITHUB_WORKSPACE/* libs/regex
working-directory: ../boost-root
- name: Install deps
run: python tools/boostdep/depinst/depinst.py -I example -g "--jobs 3" regex
working-directory: ../boost-root
- name: Bootstrap
run: ./bootstrap.sh
working-directory: ../boost-root
- name: Generate headers
run: ./b2 headers
working-directory: ../boost-root
- name: Generate user config
run: 'echo "using $TOOLSET : : ${{ matrix.compiler }} : <cxxflags>-std=${{ matrix.standard }} ;" > ~/user-config.jam'
working-directory: ../boost-root
- name: Config info install
run: ../../../b2 config_info_travis_install toolset=$TOOLSET
working-directory: ../boost-root/libs/config/test
- name: Config info
run: ./config_info_travis
working-directory: ../boost-root/libs/config/test
- name: Test
run: ../../../b2 toolset=$TOOLSET define=CI_SUPPRESS_KNOWN_ISSUES define=SLOW_COMPILER
working-directory: ../boost-root/libs/regex/test
macos:
runs-on: macos-latest
strategy:
fail-fast: false
matrix:
toolset: [ clang ]
standard: [ 11, 14, 17, 2a ]
steps:
- uses: actions/checkout@v2
with:
fetch-depth: '0'
- uses: mstachniuk/ci-skip@v1
with:
commit-filter: '[skip ci];[ci skip];[CI SKIP];[SKIP CI];***CI SKIP***;***SKIP CI***;[windows];[Windows];[WINDOWS];[linux];[Linux];[LINUX]'
commit-filter-separator: ';'
fail-fast: true
- name: Checkout main boost
run: git clone -b develop --depth 1 https://github.com/boostorg/boost.git ../boost-root
- name: Update tools/boostdep
run: git submodule update --init tools/boostdep
working-directory: ../boost-root
- name: Copy files
run: cp -r $GITHUB_WORKSPACE/* libs/regex
working-directory: ../boost-root
- name: Install deps
run: python tools/boostdep/depinst/depinst.py -I example -g "--jobs 3" regex
working-directory: ../boost-root
- name: Bootstrap
run: ./bootstrap.sh
working-directory: ../boost-root
- name: Generate headers
run: ./b2 headers
working-directory: ../boost-root
- name: Config info install
run: ../../../b2 config_info_travis_install toolset=${{ matrix.toolset }} cxxstd=${{ matrix.standard }}
working-directory: ../boost-root/libs/config/test
- name: Config info
run: ./config_info_travis
working-directory: ../boost-root/libs/config/test
- name: Test
run: ../../../b2 toolset=${{ matrix.toolset }} cxxstd=${{ matrix.standard }}
working-directory: ../boost-root/libs/regex/test
windows_gcc:
runs-on: windows-2019
defaults:
run:
shell: cmd
env:
ARGS: toolset=${{ matrix.toolset }} address-model=64 cxxstd=${{ matrix.standard }}
strategy:
fail-fast: false
matrix:
toolset: [ gcc ]
standard: [ 11, 14, 17, 2a ]
steps:
- uses: actions/checkout@v2
with:
fetch-depth: '0'
- uses: mstachniuk/ci-skip@v1
with:
commit-filter: '[skip ci];[ci skip];[CI SKIP];[SKIP CI];***CI SKIP***;***SKIP CI***;[apple];[Apple];[APPLE];[linux];[Linux];[LINUX]'
commit-filter-separator: ';'
fail-fast: true
- name: Checkout main boost
run: git clone -b develop --depth 1 https://github.com/boostorg/boost.git ../boost-root
- name: Update tools/boostdep
run: git submodule update --init tools/boostdep
working-directory: ../boost-root
- name: Copy files
run: xcopy /s /e /q %GITHUB_WORKSPACE% libs\regex
working-directory: ../boost-root
- name: Install deps
run: python tools/boostdep/depinst/depinst.py -I example -g "--jobs 3" regex
working-directory: ../boost-root
- name: Bootstrap
run: bootstrap
working-directory: ../boost-root
- name: Generate headers
run: b2 headers
working-directory: ../boost-root
- name: Config info install
run: ..\..\..\b2 config_info_travis_install %ARGS%
working-directory: ../boost-root/libs/config/test
- name: Config info
run: config_info_travis
working-directory: ../boost-root/libs/config/test
- name: Test
run: ..\..\..\b2 --hash %ARGS%
working-directory: ../boost-root/libs/regex/test
windows_msvc_14_0:
runs-on: windows-2019
defaults:
run:
shell: cmd
env:
ARGS: toolset=${{ matrix.toolset }} address-model=64 cxxstd=${{ matrix.standard }}
strategy:
fail-fast: false
matrix:
toolset: [ msvc-14.0 ]
standard: [ 14, 17 ]
steps:
- uses: actions/checkout@v2
with:
fetch-depth: '0'
- uses: mstachniuk/ci-skip@v1
with:
commit-filter: '[skip ci];[ci skip];[CI SKIP];[SKIP CI];***CI SKIP***;***SKIP CI***;[apple];[Apple];[APPLE];[linux];[Linux];[LINUX]'
commit-filter-separator: ';'
fail-fast: true
- name: Checkout main boost
run: git clone -b develop --depth 1 https://github.com/boostorg/boost.git ../boost-root
- name: Update tools/boostdep
run: git submodule update --init tools/boostdep
working-directory: ../boost-root
- name: Copy files
run: xcopy /s /e /q %GITHUB_WORKSPACE% libs\regex
working-directory: ../boost-root
- name: Install deps
run: python tools/boostdep/depinst/depinst.py -I example -g "--jobs 3" regex
working-directory: ../boost-root
- name: Bootstrap
run: bootstrap
working-directory: ../boost-root
- name: Generate headers
run: b2 headers
working-directory: ../boost-root
- name: Config info install
run: ..\..\..\b2 config_info_travis_install %ARGS%
working-directory: ../boost-root/libs/config/test
- name: Config info
run: config_info_travis
working-directory: ../boost-root/libs/config/test
- name: Test
run: ..\..\..\b2 --hash %ARGS%
working-directory: ../boost-root/libs/regex/test
windows_msvc_14_2:
runs-on: windows-2019
defaults:
run:
shell: cmd
env:
ARGS: toolset=${{ matrix.toolset }} address-model=64 cxxstd=${{ matrix.standard }}
strategy:
fail-fast: false
matrix:
toolset: [ msvc-14.2 ]
standard: [ 14, 17, latest ]
steps:
- uses: actions/checkout@v2
with:
fetch-depth: '0'
- uses: mstachniuk/ci-skip@v1
with:
commit-filter: '[skip ci];[ci skip];[CI SKIP];[SKIP CI];***CI SKIP***;***SKIP CI***;[apple];[Apple];[APPLE];[linux];[Linux];[LINUX]'
commit-filter-separator: ';'
fail-fast: true
- name: Checkout main boost
run: git clone -b develop --depth 1 https://github.com/boostorg/boost.git ../boost-root
- name: Update tools/boostdep
run: git submodule update --init tools/boostdep
working-directory: ../boost-root
- name: Copy files
run: xcopy /s /e /q %GITHUB_WORKSPACE% libs\regex
working-directory: ../boost-root
- name: Install deps
run: python tools/boostdep/depinst/depinst.py -I example -g "--jobs 3" regex
working-directory: ../boost-root
- name: Bootstrap
run: bootstrap
working-directory: ../boost-root
- name: Generate headers
run: b2 headers
working-directory: ../boost-root
- name: Config info install
run: ..\..\..\b2 config_info_travis_install %ARGS%
working-directory: ../boost-root/libs/config/test
- name: Config info
run: config_info_travis
working-directory: ../boost-root/libs/config/test
- name: Test
run: ..\..\..\b2 --hash %ARGS%
working-directory: ../boost-root/libs/regex/test
windows_msvc_14_3:
runs-on: windows-2022
defaults:
run:
shell: cmd
env:
ARGS: toolset=${{ matrix.toolset }} address-model=64 cxxstd=${{ matrix.standard }}
strategy:
fail-fast: false
matrix:
toolset: [ msvc-14.3 ]
standard: [ 14, 17, 20, latest ]
steps:
- uses: actions/checkout@v2
with:
fetch-depth: '0'
- uses: mstachniuk/ci-skip@v1
with:
commit-filter: '[skip ci];[ci skip];[CI SKIP];[SKIP CI];***CI SKIP***;***SKIP CI***;[apple];[Apple];[APPLE];[linux];[Linux];[LINUX]'
commit-filter-separator: ';'
fail-fast: true
- name: Checkout main boost
run: git clone -b develop --depth 1 https://github.com/boostorg/boost.git ../boost-root
- name: Update tools/boostdep
run: git submodule update --init tools/boostdep
working-directory: ../boost-root
- name: Copy files
run: xcopy /s /e /q %GITHUB_WORKSPACE% libs\regex
working-directory: ../boost-root
- name: Install deps
run: python tools/boostdep/depinst/depinst.py -I example -g "--jobs 3" regex
working-directory: ../boost-root
- name: Bootstrap
run: bootstrap
working-directory: ../boost-root
- name: Generate headers
run: b2 headers
working-directory: ../boost-root
- name: Config info install
run: ..\..\..\b2 config_info_travis_install %ARGS%
working-directory: ../boost-root/libs/config/test
- name: Config info
run: config_info_travis
working-directory: ../boost-root/libs/config/test
- name: Test
run: ..\..\..\b2 --hash %ARGS%
working-directory: ../boost-root/libs/regex/test
ubuntu-cmake-install:
runs-on: ubuntu-20.04
strategy:
fail-fast: false
steps:
- uses: actions/checkout@v2
with:
fetch-depth: '0'
- name: Checkout main boost
run: git clone -b develop --depth 1 https://github.com/boostorg/boost.git ../boost-root
- name: Update tools/boostdep
run: git submodule update --init tools/boostdep
working-directory: ../boost-root
- name: Copy files
run: cp -r $GITHUB_WORKSPACE/* libs/regex
working-directory: ../boost-root
- name: Install deps
run: python tools/boostdep/depinst/depinst.py -I example -g "--jobs 3" regex
working-directory: ../boost-root
- name: Bootstrap
run: ./bootstrap.sh
working-directory: ../boost-root
- name: CMake Test
working-directory: ../boost-root
run: |
mkdir __build__ && cd __build__
cmake -DBOOST_ENABLE_CMAKE=1 -DBoost_VERBOSE=1 -DBOOST_INCLUDE_LIBRARIES="regex;core" -DBUILD_TESTING=OFF -DCMAKE_INSTALL_PREFIX=~/.local ..
cmake --build . --target install
cd ../libs/regex/test/cmake_install_test && mkdir __build__ && cd __build__
cmake -DCMAKE_INSTALL_PREFIX=~/.local ..
cmake --build .
cmake --build . --target check
ubuntu-cmake-check:
runs-on: ubuntu-20.04
strategy:
fail-fast: false
steps:
- uses: actions/checkout@v2
with:
fetch-depth: '0'
- name: Install packages
run: sudo apt install libicu-dev
- name: Checkout main boost
run: git clone -b develop --depth 1 https://github.com/boostorg/boost.git ../boost-root
- name: Update tools/boostdep
run: git submodule update --init tools/boostdep
working-directory: ../boost-root
- name: Copy files
run: cp -r $GITHUB_WORKSPACE/* libs/regex
working-directory: ../boost-root
- name: Install deps
run: python tools/boostdep/depinst/depinst.py -I example -g "--jobs 3" regex
working-directory: ../boost-root
- name: Bootstrap
run: ./bootstrap.sh
working-directory: ../boost-root
- name: CMake Test
working-directory: ../boost-root/libs/regex/test
run: |
cd cmake_subdir_test && mkdir __build__ && cd __build__
cmake ..
cmake --build .
cmake --build . --target check
rm -rf *
echo Standalone configuration
cmake -DBOOST_REGEX_STANDALONE=on ..
cmake --build .
cmake --build . --target check
cd ../../cmake_subdir_test_icu && mkdir __build__ && cd __build__
cmake ..
cmake --build .
cmake --build . --target check
rm -rf *
echo Standalone configuration
cmake -DBOOST_REGEX_STANDALONE=on ..
cmake --build .
cmake --build . --target check

88
CMakeLists.txt Normal file
View File

@ -0,0 +1,88 @@
# Copyright 2018 Mike Dev
# Copyright 2019 Peter Dimov
# Distributed under the Boost Software License, Version 1.0.
# See accompanying file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt
if(NOT DEFINED IDF_TARGET)
# We support CMake 3.5, but prefer 3.16 policies and behavior
cmake_minimum_required(VERSION 3.5...3.16)
project(boost_regex VERSION "${BOOST_SUPERPROJECT_VERSION}" LANGUAGES CXX)
add_library(boost_regex INTERFACE)
add_library(Boost::regex ALIAS boost_regex)
target_include_directories(boost_regex INTERFACE include)
option(BOOST_REGEX_STANDALONE "Boost.Regex: Enable Standalone Mode (i.e. no Boost dependencies)")
if(NOT BOOST_REGEX_STANDALONE)
target_link_libraries(boost_regex
INTERFACE
Boost::config
Boost::throw_exception
Boost::predef
Boost::assert
)
else()
target_compile_definitions(boost_regex
INTERFACE BOOST_REGEX_STANDALONE
)
endif()
find_package(ICU COMPONENTS data i18n uc QUIET)
#option(BOOST_REGEX_ENABLE_ICU "Boost.Regex: enable ICU support" ${ICU_FOUND})
if(ICU_FOUND)
add_library(boost_regex_icu INTERFACE)
add_library(Boost::regex_icu ALIAS boost_regex_icu)
target_include_directories(boost_regex_icu INTERFACE include)
if(NOT BOOST_REGEX_STANDALONE)
target_link_libraries(boost_regex_icu
INTERFACE
Boost::config
Boost::throw_exception
Boost::predef
Boost::assert
)
else()
target_compile_definitions(boost_regex_icu
INTERFACE BOOST_REGEX_STANDALONE
)
endif()
find_package(ICU COMPONENTS data i18n uc REQUIRED)
target_link_libraries(boost_regex_icu INTERFACE ICU::data ICU::i18n ICU::uc)
endif()
else()
FILE(GLOB_RECURSE headers include/*.h include/*.hpp)
idf_component_register(
SRCS
${headers}
INCLUDE_DIRS
include
REQUIRES
boost_config
boost_throw_exception
boost_predef
boost_assert
)
endif()

47
README.md Normal file
View File

@ -0,0 +1,47 @@
Boost Regex Library
============================
The Boost Regex library provides regular expression support for C++, this library is the ancestor to std::regex and still goes beyond
and offers some advantages to, the standard version.
The full documentation is available on [boost.org](http://www.boost.org/doc/libs/release/libs/regex/index.html).
## Standalone Mode ##
This library may now be used in "standalone" mode without the rest of the Boost C++ libraries, in order to do this you must either:
* Have a C++17 compiler that supports __has_include, in this case if <boost/config.hpp> is not present then the library will automoatically enter standalone mode. Or:
* Define BOOST_REGEX_STANDALONE when building.
The main difference between the 2 modes, is that when Boost.Config is present the library will automatically configure itself around various compiler defects. In particular in order to use the library with exception support turned off, you will either need a copy of Boost.Config in your include path, or else manually define BOOST_NO_EXCEPTIONS when building.
In any event, to obtain a standalone version of this library, simply download a .zip of the "master" branch of this repository.
## Support, bugs and feature requests ##
Bugs and feature requests can be reported through the [Gitub issue tracker](https://github.com/boostorg/regex/issues)
(see [open issues](https://github.com/boostorg/regex/issues) and
[closed issues](https://github.com/boostorg/regex/issues?utf8=%E2%9C%93&q=is%3Aissue+is%3Aclosed)).
You can submit your changes through a [pull request](https://github.com/boostorg/regex/pulls).
There is no mailing-list specific to Boost Regex, although you can use the general-purpose Boost [mailing-list](http://lists.boost.org/mailman/listinfo.cgi/boost-users) using the tag [regex].
## Development ##
Clone the whole boost project, which includes the individual Boost projects as submodules ([see boost+git doc](https://github.com/boostorg/boost/wiki/Getting-Started)):
git clone https://github.com/boostorg/boost
cd boost
git submodule update --init
The Boost Regex Library is located in `libs/regex/`.
### Running tests ###
First, make sure you are in `libs/regex/test`.
You can either run all the tests listed in `Jamfile.v2` or run a single test:
../../../b2 <- run all tests
../../../b2 regex_regress <- single test

File diff suppressed because it is too large Load Diff

165
build/Jamfile.v2 Normal file
View File

@ -0,0 +1,165 @@
# copyright John Maddock 2003
# Distributed under the Boost Software License, Version 1.0.
# (See accompanying file LICENSE_1_0.txt or copy at
# http://www.boost.org/LICENSE_1_0.txt.
import modules ;
import testing ;
import errors ;
project : requirements
# default to all warnings on:
<warnings>all
;
local disable-icu = [ MATCH (--disable-icu) : [ modules.peek : ARGV ] ] ;
rule path_options ( properties * )
{
local result ;
if <address-model>64 in $(properties) && <toolset>msvc in $(properties)
{
result = <search>$(ICU_PATH)/bin64 <search>$(ICU_PATH)/lib64 ;
}
else
{
result = <search>$(ICU_PATH)/bin <search>$(ICU_PATH)/lib ;
}
return $(result) ;
}
#
# ICU configuration:
#
if ! $(disable-icu)
{
if [ modules.peek : ICU_LINK ]
{
errors.user-error : "The ICU_LINK option is no longer supported by the Boost.Regex build - please refer to the documentation for equivalent options" ;
}
if [ modules.peek : ICU_PATH ]
{
ICU_PATH = [ modules.peek : ICU_PATH ] ;
}
if [ modules.peek : ICU_ICUUC_NAME ]
{
ICU_ICUUC_NAME = [ modules.peek : ICU_ICUUC_NAME ] ;
}
if [ modules.peek : ICU_ICUDT_NAME ]
{
ICU_ICUDT_NAME = [ modules.peek : ICU_ICUDT_NAME ] ;
}
if [ modules.peek : ICU_ICUIN_NAME ]
{
ICU_ICUIN_NAME = [ modules.peek : ICU_ICUIN_NAME ] ;
}
if $(ICU_ICUUC_NAME)
{
lib icuuc : : <name>$(ICU_ICUUC_NAME) <conditional>@path_options ;
}
else
{
lib icuuc : : <runtime-link>shared <conditional>@path_options ;
lib icuuc : : <toolset>msvc <variant>debug <name>icuucd <runtime-link>shared <conditional>@path_options ;
lib icuuc : : <toolset>intel <target-os>windows <variant>debug <name>icuucd <runtime-link>shared <conditional>@path_options ;
lib icuuc : : <name>sicuuc <runtime-link>static <conditional>@path_options ;
lib icuuc : : <toolset>msvc <variant>debug <name>sicuucd <runtime-link>static <conditional>@path_options ;
lib icuuc : : <toolset>intel <target-os>windows <variant>debug <name>sicuucd <runtime-link>static <conditional>@path_options ;
lib icuuc : : <name>this_is_an_invalid_library_name ;
}
if $(ICU_ICUDT_NAME)
{
lib icudt : : <name>$(ICU_ICUDT_NAME) <conditional>@path_options ;
}
else
{
lib icudt : : <name>icudata <runtime-link>shared <conditional>@path_options ;
lib icudt : : <name>icudt <toolset>msvc <runtime-link>shared <conditional>@path_options ;
lib icudt : : <name>icudt <toolset>intel <target-os>windows <runtime-link>shared <conditional>@path_options ;
lib icudt : : <name>sicudata <runtime-link>static <conditional>@path_options ;
lib icudt : : <name>sicudt <toolset>msvc <runtime-link>static <conditional>@path_options ;
lib icudt : : <name>sicudt <toolset>intel <target-os>windows <runtime-link>static <conditional>@path_options ;
lib icudt : : <name>this_is_an_invalid_library_name ;
}
if $(ICU_ICUIN_NAME)
{
lib icuin : : <name>$(ICU_ICUIN_NAME) <conditional>@path_options ;
}
else
{
lib icuin : : <name>icui18n <runtime-link>shared <conditional>@path_options ;
lib icuin : : <toolset>msvc <variant>debug <name>icuind <runtime-link>shared <conditional>@path_options ;
lib icuin : : <toolset>msvc <name>icuin <runtime-link>shared <conditional>@path_options ;
lib icuin : : <toolset>intel <target-os>windows <variant>debug <name>icuind <runtime-link>shared <conditional>@path_options ;
lib icuin : : <toolset>intel <target-os>windows <name>icuin <runtime-link>shared <conditional>@path_options ;
lib icuin : : <name>sicui18n <runtime-link>static <conditional>@path_options ;
lib icuin : : <toolset>msvc <variant>debug <name>sicuind <runtime-link>static <conditional>@path_options ;
lib icuin : : <toolset>msvc <name>sicuin <runtime-link>static <conditional>@path_options ;
lib icuin : : <toolset>intel <target-os>windows <variant>debug <name>sicuind <runtime-link>static <conditional>@path_options ;
lib icuin : : <toolset>intel <target-os>windows <name>sicuin <runtime-link>static <conditional>@path_options ;
lib icuin : : <name>this_is_an_invalid_library_name ;
}
ICU_OPTS =
<include>$(ICU_PATH)/include
<runtime-link>shared:<library>icuuc/<link>shared
<runtime-link>shared:<library>icudt/<link>shared
<runtime-link>shared:<library>icuin/<link>shared
<runtime-link>static:<library>icuuc
<runtime-link>static:<library>icudt
<runtime-link>static:<library>icuin
<target-os>windows,<toolset>clang:<linkflags>"advapi32.lib"
<define>BOOST_HAS_ICU=1
<runtime-link>static:<define>U_STATIC_IMPLEMENTATION=1
;
if [ modules.peek : ICU_DATA_DIR ]
{
rule data-dir-options ( properties * )
{
local result ;
local data_dir = [ modules.peek : ICU_DATA_DIR ] ;
if <toolset>emscripten in $(properties)
{
result = <define>ICU_DATA_DIR=\\\"/$(data_dir:BS)\\\"
"<linkflags>--embed-file $(data_dir)@/$(data_dir:BS)"
;
}
else
{
result = <define>ICU_DATA_DIR=\\\"$(data_dir)\\\" ;
}
return $(result) ;
}
ICU_OPTS += <conditional>@data-dir-options ;
}
}
exe has_icu : has_icu_test.cpp : $(ICU_OPTS) ;
explicit has_icu ;
obj is_legacy_03 : is_legacy_03.cpp ;
explicit is_legacy_03 ;
alias icu_options : : : : [ check-target-builds has_icu : $(ICU_OPTS) : ] ;
SOURCES =
posix_api.cpp
regex.cpp
regex_debug.cpp
static_mutex.cpp
wide_posix_api.cpp
;
lib boost_regex : ../src/$(SOURCES) icu_options
:
<link>shared:<define>BOOST_REGEX_DYN_LINK=1
<toolset>gcc-cygwin:<link>static
;
boost-install boost_regex ;

56
build/has_icu_test.cpp Normal file
View File

@ -0,0 +1,56 @@
/*
*
* Copyright (c) 2010
* John Maddock
*
* Use, modification and distribution are subject to the
* Boost Software License, Version 1.0. (See accompanying file
* LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
*
*/
#include <unicode/uversion.h>
#include <unicode/utypes.h>
#include <unicode/uchar.h>
#include <unicode/coll.h>
#include <boost/scoped_ptr.hpp>
#include <iostream>
#include <iomanip>
#if defined(_MSC_VER) && !defined(_DLL)
//#error "Mixing ICU with a static runtime doesn't work"
#endif
void print_error(UErrorCode err, const char* func)
{
std::cerr << "Error from function " << func << " with error: " << ::u_errorName(err) << std::endl;
}
int main()
{
#ifdef ICU_DATA_DIR
::u_setDataDirectory(ICU_DATA_DIR);
#endif
// To detect possible binary mismatches between the installed ICU build, and whatever
// C++ std lib's we're using, we need to:
// * Make sure we call ICU C++ API's
// * Make sure we call std lib C++ API's as well (cout).
// * Be sure this program is run, not just built.
UErrorCode err = U_ZERO_ERROR;
UChar32 c = ::u_charFromName(U_UNICODE_CHAR_NAME, "GREEK SMALL LETTER ALPHA", &err);
std::cout << (int)c << std::endl;
if(err > 0)
{
print_error(err, "u_charFromName");
return err;
}
U_NAMESPACE_QUALIFIER Locale l;
boost::scoped_ptr<U_NAMESPACE_QUALIFIER Collator> p_col(U_NAMESPACE_QUALIFIER Collator::createInstance(l, err));
if(err > 0)
{
print_error(err, "Collator::createInstance");
return err;
}
return err > 0 ? err : 0;
}

16
build/is_legacy_03.cpp Normal file
View File

@ -0,0 +1,16 @@
/*
*
* Copyright (c) 2020
* John Maddock
*
* Use, modification and distribution are subject to the
* Boost Software License, Version 1.0. (See accompanying file
* LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
*
*/
#include <boost/regex/config.hpp>
#ifdef BOOST_REGEX_CXX03
#error "Legacy mode"
#endif

View File

@ -1,236 +0,0 @@
FIXED: Signed/unsigned conversions in regex_compile.hpp and regex_format.hpp
ADDED: Forwarder functions to match_results.
FIXED: More errors from Como in strict mode.
Version 303:
FIXED: Code glitches for Como compiler in strict mode.
FIXED: Missing fixes for cstdio header.
FIXED: memory leak in underlying w32 traits classes
FIXED: vc6 clean option to remove *.pch files.
CHANGED: Build options for VC6 to avoid compiler optimisation bug.
FIXED: Missing BOOST_RE_NO_WCSTRING guard around using declaration in regex.h
FIXED: Pathological regular expressions in snip4.cpp and in docs.
FIXED: Missing std:: prefixes in some headers.
Version 302:
FIXED: STLPort debug problems.
FIXED: Compatibility with updated Dinkum libraries and VC6.
ADDED: Tentative support for partial matches (not yet documented).
Version 301:
First boost release version,
CHANGED: reg_match to match_results
CHANGED: Documentation updated to reflect changes, provided links to sources from docs.
CHANGED: RegEx(const char*) constructor to explicit.
CHANGED: Return type of RegEx::Split to unsigned int.
ADDED: Exception documentation for OS errors.
REMOVED: BOOST_RE_NO_EXCEPTIONS macro.
FIXED: mapfile::open/close to check for OS errors.
FIXED: Non-exception safe code in cpp_regex_traits.
FIXED: Removed undefined symbol INFINITE from re_thrd.hpp
FIXED: Bug in configure script thread detection code.
CHANGED: "depreciated" to "deprecated"
FIXED: Documentation error for bad_expression.
CHANGED: regbase::flag_type to unsigned int
ADDED: explicit constructors to reg_expression/match_results
ADDED: extra signatures for regex_format/regex_merge for std::string arguments.
REMOVED: bad_pattern/bad_expression::what from regex.cpp
REMOVED: Implicit conversion operators from sub_match (except for conversion to basic_string).
Version 300:
Candidate release boost version,
ADDED: Support for non-greedy repeats.
ADDED: Support for non-marking grouping.
ADDED: Auto-detection of STLPort STL versions.
CHANGED: Re-written and re-organised traits classes.
CHANGED: Regression test make files for more rigorous testing of all build versions.
Version 249:
Pre-release boost version,
CHANGED: All macro prefixes to BOOST_RE_
CHANGED: namespaces to boost
CHANGED: Header file extentions to .hpp
DEPRECIATED: Old style algorithms, replaced with more consistant naming style.
DEPRECIATED: Standard library independant compiles no longer possible, bespoke
classes replaced with standard library/boost equivalents where available.
Version 221:
ADDED: C++ Builder 3 workaround in boost/detail/jgrep.hpp
Version 220:
ADDED: Merge functions to class RegEx
Version 218:
FIXED: All known bugs prior to this version.
FIXED: Added workaround for gcc optimisation bug to jm/regmatch.h
ADDED: Cygwin mount point support.
Version 217:
BUG: configure script did not correctly identify template
friend support, or template function partial ordering support.
FIXED: All known bugs prior to this version.
Version 216:
BUG: Some RegEx::Grep variants buggy.
BUG: FileIterator leaked memory.
BUG: Memory alignment problems with gcc/sparc platform
CHANGED: RegEx callback declarations to cope with VC6 builds using
non-default calling conventions.
CHANGED: Some configuration options to try and keep Mingwin32 port
of gcc 2.95 happy.
FIXED: Bug in RegEx::What introduced in version 214 fix :-(
Version 215:
CHANGED: Added #pragma push/pop to fix C++ Builder 3 problems.
CHANGED: Wide to narrow character conversions, to be more conformant with standard.
CHANGED: Minor documentation updates.
Version 214:
FIXED All known bugs rpior to this point.
CHANGED: Minor changes to keep VC5 and GCC 2.95 happy.
Version 213:
BUG: Far eastern versions of Win32 could not compile
re_nlsw.cpp due to string literal - code page
interactions.
ADDED: Convenience conversion operators to sub_match<>.
CHANGED: Removed REG_E_MEMORY as it duplicates REG_ESPACE.
ADDED: Additional tests to regress.
CHANGED: RegEx::GrepFiles and RegEx::FindFiles previously had undefined
behaviour if the callback returned false, changed to abort
the whole search if the callback returns false.
FIXED: All known bugs prior to this release.
Version 212:
BUG: Use of catopen in re_mss.cpp causes problems on some systems.
BUG: Comparison operators for reg_expression and reg_match should be const.
BUG: Missing output iterator increment in regfmt.h.
ADDED: REG_NOCOLLATE, so that locale dependent collation can be turned off for
the POSIX C API's as well as the underlying templates.
CHANGED: Misc. documentation updates.
FIXED: Linking problem for some egcs ports.
CHANGED: Tightened up exception safety.
ADDED: Convenience interfaces to query_match, reg_search, reg_grep, reg_format and reg_merge.
ADDED: Convenience std::string overloads of reg_expression members.
FIXED: All bugs found prior to this release.
Version 211:
BUG: RegEx::GrepFiles fails to log sub-expression matches correctly.
BUG: file_iterator/directory_iterator fail to find all files when using '*'.
CHANGED: Changes required to make the code compile with HP's aCC compiler.
CHANGED: Using declarations, to hide implimentation details.
CHANGED: Behavior of ^ and $ to follow Unicode newline guidelines and account
for \r\n sequences.
Version 210:
FIXED: All known bugs prior to this point.
ADDED: configure shell script for porting to Unix style systems.
CHANGED: jm::reg_match_base::pair to jm::sub_match, for easier porting.
Version 200:
BUG: RegEx::GrepFiles buggy
BUG: RegEx::FindFiles buggy
BUG: non-portable header file usage in fileiter.h
BUG: non-portable enum declarations in headers.
BUG: non-portable use of isspace in regfacet.cpp
BUG: Missing regfac.obj from bcb makefiles.
BUG: non-portable declaration of type jm::reg_match_base::reference.
BUG: missing <wchar.h> declaration required by some systems.
BUG: Use of JM_NO_WCSTRING incomplete.
BUG: Misspelled JM_NO_EXCEPTIONS in places.
BUG: regfmt.h has typo on line 538.
BUG: reg_format and reg_merge not portable to all output iterator types.
BUG: non-portable use of typedefs.
BUG: non-portable use of friend declarations.
CHANGED: Allocator usage, to improve efficiency with instance based allocators.
CHANGED: regress.h, various fixes for various Borland C++ versions, allocators cleaned up.
ADDED: Win32 specific localisation code.
ADDED: C and C++ specific localisation code.
ADDED: collating element and equivalence class support.
CHANGED: Character class declarations.
CHANGED: Behaviour of ranges to deal with locales.
ADDED: Support for some perl escape sequences (but not yet (?...) ).
CHANGED: regbase::icase flag now turns on case insensitivity,
traits class char_regex_traits_i is now deprecated.
CHANGED: reg_grep now takes a predicate not an output iterator,
allows user code to terminate search midway through,
and to use regular callback function with grep.
CHANGED: Modified search heuristics to improve certain expression
types, especially expressions which start with a literal
string, or a single character repeat. The latter are much
less likely to become pathological now.
ADDED: High level C++ class RegEx.
Version 111:
BUG: Wouldn't compile directly on C++ Builder 4 when it was released
(not really a bug - more an incompatability)
FIXED: All bugs discovered prior to this version (below).
Version 110:
BUG: reg_match::maybe_assign could lead to pointer
overrun in certain (rare) circumstances.
FIXED: All bugs discovered prior to this version (below).
FIXED: Support for VC++, GCC, EGCS.
CHANGED: Regress.h to work around various compiler bugs.
Version 100:
BUG: Literal "," not recognised as a literal.
FIXED: All bugs discovered prior to this version (below).
ADDED: Regress.exe, regression test application.
Version 095
BUG: wide character sets that start with ^ not recognised,
for example [^[:space:]] will not find anything.
BUG: reg_grep fails if match occurs at first character.
BUG: If regcomp fails, internal data not freed.
BUG: reg_grep fails to reinitialise match after assignment
to output iterator. Line start optimised search restarts
from the wrong location if the match is longer than one line.
BUG: POSIX API functions can propagate C++ exceptions if the
default allocator can throw exceptions.
BUG: character sets don't function correctly when regbase::char_classes
is not set.

4096
configure vendored

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

View File

@ -1,64 +0,0 @@
/*
*
* Copyright (c) 1998-2000
* Dr John Maddock
*
* Permission to use, copy, modify, distribute and sell this software
* and its documentation for any purpose is hereby granted without fee,
* provided that the above copyright notice appear in all copies and
* that both that copyright notice and this permission notice appear
* in supporting documentation. Dr John Maddock makes no representations
* about the suitability of this software for any purpose.
* It is provided "as is" without express or implied warranty.
*
*/
/*
* LOCATION: see http://www.boost.org for most recent version.
* FILE posix_api_compiler_check.c
* VERSION 3.01
* DESCRIPTION: Verify that POSIX API calls compile: note this is a compile
* time check only.
*/
#include <stdio.h>
#include <string.h>
#include <assert.h>
#include <boost/regex.h>
const char* expression = "^";
const char* text = "\n ";
regmatch_t matches[1];
int flags = REG_EXTENDED | REG_BASIC | REG_NOSPEC | REG_ICASE | REG_NOSUB |
REG_NEWLINE | REG_PEND | REG_NOCOLLATE | REG_ESCAPE_IN_LISTS |
REG_NEWLINE_ALT | REG_PERL | REG_AWK | REG_GREP | REG_EGREP;
int main()
{
regex_t re;
int result;
result = regcomp(&re, expression, REG_AWK);
if(result > REG_NOERROR)
{
char buf[256];
regerror(result, &re, buf, sizeof(buf));
printf(buf);
return result;
}
assert(re.re_nsub == 0);
matches[0].rm_so = 0;
matches[0].rm_eo = strlen(text);
result = regexec(&re, text, 1, matches, REG_NOTBOL | REG_NOTEOL | REG_STARTEND);
if(result > REG_NOERROR)
{
char buf[256];
regerror(result, &re, buf, sizeof(buf));
printf(buf);
regfree(&re);
return result;
}
assert(matches[0].rm_so == matches[0].rm_eo == 1);
regfree(&re);
return 0;
}

View File

@ -1,64 +0,0 @@
/*
*
* Copyright (c) 1998-2000
* Dr John Maddock
*
* Permission to use, copy, modify, distribute and sell this software
* and its documentation for any purpose is hereby granted without fee,
* provided that the above copyright notice appear in all copies and
* that both that copyright notice and this permission notice appear
* in supporting documentation. Dr John Maddock makes no representations
* about the suitability of this software for any purpose.
* It is provided "as is" without express or implied warranty.
*
*/
/*
* LOCATION: see http://www.boost.org for most recent version.
* FILE posix_api_compiler_check.c
* VERSION 3.01
* DESCRIPTION: Verify that POSIX API calls compile: note this is a compile
* time check only.
*/
#include <stdio.h>
#include <string.h>
#include <assert.h>
#include <boost/regex.h>
const char* expression = "^";
const char* text = "\n ";
regmatch_t matches[1];
int flags = REG_EXTENDED | REG_BASIC | REG_NOSPEC | REG_ICASE | REG_NOSUB |
REG_NEWLINE | REG_PEND | REG_NOCOLLATE | REG_ESCAPE_IN_LISTS |
REG_NEWLINE_ALT | REG_PERL | REG_AWK | REG_GREP | REG_EGREP;
int main()
{
regex_t re;
int result;
result = regcomp(&re, expression, REG_AWK);
if(result > REG_NOERROR)
{
char buf[256];
regerror(result, &re, buf, sizeof(buf));
printf(buf);
return result;
}
assert(re.re_nsub == 0);
matches[0].rm_so = 0;
matches[0].rm_eo = strlen(text);
result = regexec(&re, text, 1, matches, REG_NOTBOL | REG_NOTEOL | REG_STARTEND);
if(result > REG_NOERROR)
{
char buf[256];
regerror(result, &re, buf, sizeof(buf));
printf(buf);
regfree(&re);
return result;
}
assert(matches[0].rm_so == matches[0].rm_eo == 1);
regfree(&re);
return 0;
}

View File

@ -1,49 +0,0 @@
# very basic makefile for jgrep.exe
#
# Borland C++ tools
#
# BCROOT defines the root directory of your bc builder install
#
!ifndef BCROOT
BCROOT=$(MAKEDIR)\..
!endif
BCC32 = $(BCROOT)\bin\Bcc32.exe
LIBPATH=..\..\lib\bcb5
IDE_LinkFLAGS32 = -L$(BCROOT)\LIB
LINKOPTS= -ap -Tpe -x
COMPOPTS= -O2 -tWM- -DSTRICT; -I$(BCROOT)\include;../../../../; -D_NO_VCL
jgrep.exe : jgrep.obj main.obj
$(BCC32) $(COMPOPTS) -e$@ -L$(LIBPATH) main.obj jgrep.obj
jgrep.obj : jgrep.cpp
$(BCC32) -c @&&|
$(COMPOPTS) -o$@ jgrep.cpp
|
main.obj : main.cpp
$(BCC32) -c @&&|
$(COMPOPTS) -o$@ main.cpp
|

View File

@ -1,49 +0,0 @@
# very basic makefile for jgrep.exe
#
# Borland C++ tools
#
# BCROOT defines the root directory of your bc builder install
#
!ifndef BCROOT
BCROOT=$(MAKEDIR)\..
!endif
BCC32 = $(BCROOT)\bin\Bcc32.exe
LIBPATH="..\..\lib\bcb4"
IDE_LinkFLAGS32 = -L$(BCROOT)\LIB
LINKOPTS= -ap -Tpe -x
COMPOPTS= -O2 -tWM- -DSTRICT; -I$(BCROOT)\include;../../../../; -D_NO_VCL
jgrep.exe : jgrep.obj main.obj
$(BCC32) @&&|
$(COMPOPTS) -e$@ -L$(LIBPATH) main.obj jgrep.obj
|
jgrep.obj : jgrep.cpp
$(BCC32) -c @&&|
$(COMPOPTS) -o$@ jgrep.cpp
|
main.obj : main.cpp
$(BCC32) -c @&&|
$(COMPOPTS) -o$@ main.cpp
|

View File

@ -1,47 +0,0 @@
# very basic makefile for jgrep.exe
#
# Borland C++ tools
#
# BCROOT defines the root directory of your bc builder install
#
!ifndef BCROOT
BCROOT=$(MAKEDIR)\..
!endif
BCC32 = $(BCROOT)\bin\Bcc32.exe
LIBPATH=../../lib/bcb5
IDE_LinkFLAGS32 = -L$(BCROOT)\LIB
LINKOPTS= -ap -Tpe -x
COMPOPTS= -O2 -tWM- -DSTRICT; -I$(BCROOT)\include;../../../../; -D_NO_VCL
jgrep.exe : jgrep.obj main.obj
$(BCC32) $(COMPOPTS) -e$@ -L..\..\lib\bcb5 main.obj jgrep.obj
jgrep.obj : jgrep.cpp
$(BCC32) -c @&&|
$(COMPOPTS) -o$@ jgrep.cpp
|
main.obj : main.cpp
$(BCC32) -c @&&|
$(COMPOPTS) -o$@ main.cpp
|

View File

@ -1,30 +0,0 @@
# very basic makefile for jgrep
#
# GNU compiler g++
#
CXX= -O2 -I../../../../ -I./
jgrep : jgrep.cpp main.cpp
g++ -ojgrep $(CXX) jgrep.cpp main.cpp -L../../lib/gcc -lregex++
debug : jgrep.cpp main.cpp
g++ -ojgrep -I../../../../ -I./ -g jgrep.cpp main.cpp -L../../lib/gcc -lregex++debug

View File

@ -1,126 +0,0 @@
/*
*
* Copyright (c) 1998-2000
* Dr John Maddock
*
* Permission to use, copy, modify, distribute and sell this software
* and its documentation for any purpose is hereby granted without fee,
* provided that the above copyright notice appear in all copies and
* that both that copyright notice and this permission notice appear
* in supporting documentation. Dr John Maddock makes no representations
* about the suitability of this software for any purpose.
* It is provided "as is" without express or implied warranty.
*
*/
/*
* FILE jgrep.cpp
* VERSION 3.03
*/
#include <stdio.h>
#include <boost/regex.hpp>
#ifdef JM_OLD_IOSTREAM
#include <iostream.h>
#else
#include <iostream>
using std::cout;
using std::cin;
using std::cerr;
using std::endl;
#endif
#pragma hrdstop
#include <boost/re_detail/fileiter.hpp>
#include "jgrep.h"
//
// class ogrep_predicate
// outputs the results of regex_grep to screen:
template <class iterator, class Allocator >
class ogrep_predicate
{
unsigned int& lines;
const char* filename;
unsigned int last_line;
iterator end_of_storage;
public:
ogrep_predicate(unsigned int& i, const char* p, iterator e) : lines(i), filename(p), last_line(-1), end_of_storage(e) {}
ogrep_predicate(const ogrep_predicate& o) : lines(o.lines), filename(o.filename), last_line(o.last_line), end_of_storage(o.end_of_storage) {}
bool operator () (const boost::match_results<iterator, Allocator>& i);
};
// ideally we'd ignor the allocator type and use a template member function
// to deel with the allocator type passed to regex_grep, unfortunately most
// compilers don't support this feature yet, so we'll have to be sure that
// the allocator passed to instances of this class match that used in our
// regular expression classes.
template <class iterator, class Allocator>
bool ogrep_predicate<iterator, Allocator>::operator()(const boost::match_results<iterator, Allocator>& i)
{
if(last_line == (unsigned int)-1)
cout << "File " << filename << ":" << endl;
if(last_line != i.line())
{
++lines;
last_line = i.line();
if(count_only == 0)
{
if(show_lines)
cout << i.line() << "\t";
iterator ptr = i.line_start();
while((ptr != end_of_storage) && (*ptr != '\n'))++ptr;
iterator pos = i.line_start();
while(pos != ptr)
{
cout.put(*pos);
++pos;
}
cout << endl;
}
}
return true;
}
void process_grep(const char* file)
{
using namespace boost;
mapfile f(file);
unsigned int count = 0;
ogrep_predicate<mapfile::iterator, allocator_type> oi(count, file, f.end());
if(files_only)
{
bool ok;
boost::match_results<mapfile::iterator, allocator_type> m;
ok = regex_search(f.begin(), f.end(), m, e, match_not_dot_newline | match_not_dot_null);
if(ok)
cout << "File " << file << endl;
}
else
{
regex_grep(oi, f.begin(), f.end(), e, match_not_dot_newline | match_not_dot_null);
if(count)
{
if(verbose || count_only)
{
cout << count << " lines match" << endl;
return;
}
}
else if(verbose)
{
cout << "File " << file << "(" << f.size() << "bytes):" << endl << "0 lines match" << endl;
}
}
}

View File

@ -1,53 +0,0 @@
/*
*
* Copyright (c) 1998-2000
* Dr John Maddock
*
* Permission to use, copy, modify, distribute and sell this software
* and its documentation for any purpose is hereby granted without fee,
* provided that the above copyright notice appear in all copies and
* that both that copyright notice and this permission notice appear
* in supporting documentation. Dr John Maddock makes no representations
* about the suitability of this software for any purpose.
* It is provided "as is" without express or implied warranty.
*
*/
/*
* FILE jgrep.h
* VERSION 3.03
*/
#ifndef _JGREP_H
#define _JGREP_H
#include <boost/regex.hpp>
// case sensitive reg_expression determines our allocator type:
typedef boost::reg_expression<char> re_type;
typedef re_type::allocator_type allocator_type;
// now declare static (global) data, including an allocator
// instance which we'll pass to all instances that require an allocator.
extern allocator_type a;
extern re_type e;
// flags for output:
extern bool use_case;
extern bool show_lines;
extern bool count_only;
extern bool files_only;
extern bool recurse;
extern bool regularexs;
extern bool words_only;
extern bool verbose;
void process_grep(const char* file);
#endif

View File

@ -1,284 +0,0 @@
/*
*
* Copyright (c) 1998-2000
* Dr John Maddock
*
* Permission to use, copy, modify, distribute and sell this software
* and its documentation for any purpose is hereby granted without fee,
* provided that the above copyright notice appear in all copies and
* that both that copyright notice and this permission notice appear
* in supporting documentation. Dr John Maddock makes no representations
* about the suitability of this software for any purpose.
* It is provided "as is" without express or implied warranty.
*
*/
/*
* FILE main.cpp
* VERSION 3.03
*/
#include <stdio.h>
#include <boost/regex.hpp>
#ifdef JM_OLD_IOSTREAM
#include <iostream.h>
#else
#include <iostream>
using std::cout;
using std::cin;
using std::cerr;
using std::endl;
#endif
#pragma hrdstop
#include <boost/re_detail/fileiter.hpp>
#include "jgrep.h"
#ifndef JM_ALGO_INCLUDED
// HP and SGI STL's use <algo.h> instead
// this will have been pulled in by <jm_cfg.h>
// for std::distance
#include <algorithm>
#endif
allocator_type a;
re_type e(a);
//rei_type ei(a);
// flags for output:
bool use_case = true;
bool show_lines = false;
bool count_only = false;
bool files_only = false;
bool recurse = false;
bool regularexs = true;
bool words_only = false;
bool verbose = false;
void usage()
{
cout <<
"jgrep version 0.95\n"
"usage: jgrep [-options] expression file [files...]\n"
"\n"
"options can be one of the following:\n"
"\n"
"-c prints a count of the number of matching lines only\n"
"-d recurses through subdirectories for matching files\n"
"-i causes case to be ignored when matching\n"
"-l lists the files which contain a match only\n"
"-n displays the line numbers of matches\n"
"-r- causes the expression to be interpreted as a literal string and not\n"
" as a regular expression\n"
"-w searches for matches that are whole words only\n"
"-z verbose mode\n"
"\n"
"expression: a regular expression, or a literal string if -r- is specified\n"
"\n"
"files: one or more files to search, the names can contain the wildcard\n"
" characters ? and *\n" << endl;
}
void parse_switch(const char* flag)
{
++flag;
while(*flag)
{
switch(*flag)
{
case '-':
switch(*(flag-1))
{
case 'c':
count_only = false;
break;
case 'd':
recurse = false;
break;
case 'i':
use_case = false;
break;
case 'l':
files_only = false;
break;
case 'n':
show_lines = false;
break;
case 'r':
regularexs = false;
break;
case 'w':
words_only = false;
break;
case 'z':
verbose = false;
break;
default:
cout << "Undefined option -";
cout.put(*flag);
cout << endl;
}
// turn off prev character:
break;
case 'c':
count_only = true;
break;
case 'd':
recurse = true;
break;
case 'i':
use_case = false;
break;
case 'l':
files_only = true;
break;
case 'n':
show_lines = true;
break;
case 'r':
regularexs = true;
break;
case 'w':
words_only = true;
break;
case 'z':
verbose = true;
break;
case '?':
usage();
exit(0);
case '+':
break;
default:
cout << "Undefined option -";
cout.put(*flag);
cout << endl;
}
++flag;
}
}
void HandleFile(const char* wild)
{
using namespace boost;
jm_trace("Handling file " << wild);
file_iterator end;
file_iterator start(wild);
if(recurse)
{
// go through sub directories:
char buf[MAX_PATH];
std::strcpy(buf, start.root());
int rootlen = strlen(buf);
if(*buf == 0)
{
std::strcpy(buf, ".");
std::strcat(buf, directory_iterator::separator());
std::strcat(buf, "*");
}
else
{
std::strcat(buf, directory_iterator::separator());
std::strcat(buf, "*");
}
jm_trace("Enumerating directories: " << buf);
directory_iterator dstart(buf);
directory_iterator dend;
// now get the file mask bit of "wild":
const char* ptr = wild + rootlen;
if(*ptr) ++ptr;
jm_trace("File mask part is: " << ptr);
while(dstart != dend)
{
std::sprintf(buf, "%s%s%s", dstart.path(), directory_iterator::separator(), ptr);
HandleFile(buf);
++dstart;
}
}
std::for_each(start, end, process_grep);
}
int done = 0;
void HandleArg(const char* arg)
{
using namespace boost;
jm_trace("Handling argument: " << arg);
if(*arg == '-')
{
parse_switch(arg);
return;
}
if(done == 0)
{
// parse regular expression
if(regularexs)
{
if(words_only == 0)
{
e.set_expression(arg, use_case ? regbase::normal : regbase::normal | regbase::icase);
//ei.set_expression(arg);
}
else
{
char* buf = new char[std::strlen(arg) + 8];
std::sprintf(buf, "\\<%s\\>", arg);
e.set_expression(buf, use_case ? regbase::normal : regbase::normal | regbase::icase);
//ei.set_expression(buf);
delete[] buf;
}
}
else
{
// we need to convert text to literal:
int len2 = std::strlen(arg);
int len = len2 * 5 + 6;
char buf[8];
char* buf2 = new char[len];
*buf2 = 0;
if(words_only)
std::strcpy(buf2, "\\<");
for(int j = 0; j < len2; ++j)
{
std::sprintf(buf, "\\0%o", int(arg[j]));
std::strcat(buf2, buf);
}
if(words_only)
std::strcat(buf2, "\\>");
e.set_expression(buf2, use_case ? regbase::normal : regbase::normal | regbase::icase);
//ei.set_expression(buf2);
delete[] buf2;
}
done = 1;
return;
}
// if we get to here we have one or more file names to process:
++done;
HandleFile(arg);
}
int main(int argc, char * argv[])
{
for(int i = 1; i < argc; ++i)
HandleArg(argv[i]);
if(done < 2)
usage();
return 0;
}

View File

@ -1,41 +0,0 @@
# very basic makefile for jgrep
#
CXX=@CXX@
CXXFLAGS=@CXXFLAGS@
LIBS=@LIBS@
EXE=@ac_exe_ext@
OBJ=@ac_obj_ext@
LIBDEP=../../lib/libregex++.a ../../../../boost/re_detail/regex_options.hpp ../../../../boost/re_detail/regex_config.hpp
jgrep$(EXE) : jgrep$(OBJ) main$(OBJ)
$(CXX) -o jgrep$(EXE) jgrep$(OBJ) main$(OBJ) -L../../lib -lregex++ $(LIBS)
jgrep$(OBJ) : jgrep.cpp jgrep.h $(LIBDEP)
$(CXX) -c $(CXXFLAGS) -I../../../../ -I./ jgrep.cpp
main$(OBJ) : main.cpp jgrep.h $(LIBDEP)
$(CXX) -c $(CXXFLAGS) -I../../../../ -I./ main.cpp

View File

@ -1,20 +0,0 @@
# Makefile for timer application
#
# for SUN workshop 5.0 C++ compiler
#
CXX=CC
CPP_FLAGS = -O -I../../../../ -I./
%.o : %.cpp
$(CXX) -c -o $@ $(CPP_FLAGS) $<
jgrep : jgrep.o main.o
$(CXX) -o $@ $(CPP_FLAGS) jgrep.o main.o -L../../lib -lregex++
clean:
rm -rf SunWS_cache
rm -f jgrep.o jgrep main.o

View File

@ -1,17 +0,0 @@
#
# very simple makefile for Visual C++ 6 + STLPort 4
#
jgrep.exe: main.cpp jgrep.cpp jgrep.h
cl -GX -GR /Oityb1 /GF /Gy -MT -I..\..\..\..\ jgrep.cpp main.cpp /link /LIBPATH:..\..\lib\vc6-stlport user32.lib

View File

@ -1,16 +0,0 @@
#
# very simple makefile for Visual C++ 6
#
jgrep.exe: main.cpp jgrep.cpp jgrep.h
cl -GX -GR /Oityb1 /GF /Gy -I..\..\..\..\ jgrep.cpp main.cpp /link /LIBPATH:..\..\lib\vc6 user32.lib

View File

@ -1,134 +0,0 @@
# very basic makefile for regress
#
# Borland C++ tools
#
# BCROOT defines the root directory of your bcb install
#
!ifndef BCROOT
BCROOT=$(MAKEDIR)\..
!endif
BCC32 = $(BCROOT)\bin\Bcc32.exe
TLINK32 = $(BCROOT)\bin\ILink32.exe
IDE_LinkFLAGS32 = -L$(BCROOT)\LIB
LINKOPTS= -ap -Tpe -x
CFLAGS= -O2 -tWC -DSTRICT; -w-inl -w-aus -w-csu -w-eff -w-rch -I$(BCROOT)\include;..\..\..\..\; -L..\..\lib\bcb5
all :: r1.exe r2.exe r3.exe r4.exe r5.exe r6.exe r1m.exe r2m.exe r3m.exe r4m.exe r5m.exe r6m.exe r1l.exe r2l.exe r3l.exe r4l.exe r5l.exe r6l.exe r1lm.exe r2lm.exe r3lm.exe r4lm.exe r5lm.exe r6lm.exe
echo testing static single threaded version....
r1 tests.txt test1252.txt
r2 tests.txt
r3 tests.txt
r4 tests.txt test1252.txt
r5 tests.txt
r6 tests.txt
echo testing static multi-threaded version....
r1m tests.txt test1252.txt
r2m tests.txt
r3m tests.txt
r4m tests.txt test1252.txt
r5m tests.txt
r6m tests.txt
echo testing dll single threaded version....
r1l tests.txt test1252.txt
r2l tests.txt
r3l tests.txt
r4l tests.txt test1252.txt
r5l tests.txt
r6l tests.txt
echo testing dll multi-threaded version....
r1lm tests.txt test1252.txt
r2lm tests.txt
r3lm tests.txt
r4lm tests.txt test1252.txt
r5lm tests.txt
r6lm tests.txt
r1.exe : tests.cpp regress.cpp parse.cpp
$(BCC32) -tWM- -D_NO_VCL $(CFLAGS) -er1.exe -DBOOST_RE_TEST_LOCALE_W32 tests.cpp regress.cpp parse.cpp
r2.exe : tests.cpp parse.cpp regress.cpp
$(BCC32) -tWM- -D_NO_VCL $(CFLAGS) -er2.exe -DBOOST_RE_TEST_LOCALE_C tests.cpp parse.cpp regress.cpp
r3.exe : tests.cpp parse.cpp regress.cpp
$(BCC32) -tWM- -D_NO_VCL $(CFLAGS) -er3.exe -DBOOST_RE_TEST_LOCALE_CPP tests.cpp parse.cpp regress.cpp
r4.exe : tests.cpp parse.cpp regress.cpp
$(BCC32) -tWM- -D_NO_VCL $(CFLAGS) -er4.exe -DBOOST_RE_TEST_LOCALE_W32 -DTEST_UNICODE tests.cpp parse.cpp regress.cpp
r5.exe : tests.cpp parse.cpp regress.cpp
$(BCC32) -tWM- -D_NO_VCL $(CFLAGS) -er5.exe -DBOOST_RE_TEST_LOCALE_C -DTEST_UNICODE tests.cpp parse.cpp regress.cpp
r6.exe : tests.cpp parse.cpp regress.cpp
$(BCC32) -tWM- -D_NO_VCL $(CFLAGS) -er6.exe -DBOOST_RE_TEST_LOCALE_CPP -DTEST_UNICODE tests.cpp parse.cpp regress.cpp
r1m.exe : tests.cpp parse.cpp regress.cpp
$(BCC32) -tWM -D_NO_VCL $(CFLAGS) -er1m.exe -DBOOST_RE_TEST_LOCALE_W32 tests.cpp parse.cpp regress.cpp
r2m.exe : tests.cpp parse.cpp regress.cpp
$(BCC32) -tWM -D_NO_VCL $(CFLAGS) -er2m.exe -DBOOST_RE_TEST_LOCALE_C tests.cpp parse.cpp regress.cpp
r3m.exe : tests.cpp parse.cpp regress.cpp
$(BCC32) -tWM -D_NO_VCL $(CFLAGS) -er3m.exe -DBOOST_RE_TEST_LOCALE_CPP tests.cpp parse.cpp regress.cpp
r4m.exe : tests.cpp parse.cpp regress.cpp
$(BCC32) -tWM -D_NO_VCL $(CFLAGS) -er4m.exe -DBOOST_RE_TEST_LOCALE_W32 -DTEST_UNICODE tests.cpp parse.cpp regress.cpp
r5m.exe : tests.cpp parse.cpp regress.cpp
$(BCC32) -tWM -D_NO_VCL $(CFLAGS) -er5m.exe -DBOOST_RE_TEST_LOCALE_C -DTEST_UNICODE tests.cpp parse.cpp regress.cpp
r6m.exe : tests.cpp parse.cpp regress.cpp
$(BCC32) -tWM -D_NO_VCL $(CFLAGS) -er6m.exe -DBOOST_RE_TEST_LOCALE_CPP -DTEST_UNICODE tests.cpp parse.cpp regress.cpp
r1l.exe : tests.cpp parse.cpp regress.cpp
$(BCC32) -tWM- -tWR -D_NO_VCL $(CFLAGS) -er1l.exe -DBOOST_RE_TEST_LOCALE_W32 tests.cpp parse.cpp regress.cpp
r2l.exe : tests.cpp parse.cpp regress.cpp
$(BCC32) -tWM- -tWR -D_NO_VCL $(CFLAGS) -er2l.exe -DBOOST_RE_TEST_LOCALE_C tests.cpp parse.cpp regress.cpp
r3l.exe : tests.cpp parse.cpp regress.cpp
$(BCC32) -tWM- -tWR -D_NO_VCL $(CFLAGS) -er3l.exe -DBOOST_RE_TEST_LOCALE_CPP tests.cpp parse.cpp regress.cpp
r4l.exe : tests.cpp parse.cpp regress.cpp
$(BCC32) -tWM- -tWR -D_NO_VCL $(CFLAGS) -er4l.exe -DBOOST_RE_TEST_LOCALE_W32 -DTEST_UNICODE tests.cpp parse.cpp regress.cpp
r5l.exe : tests.cpp parse.cpp regress.cpp
$(BCC32) -tWM- -tWR -D_NO_VCL $(CFLAGS) -er5l.exe -DBOOST_RE_TEST_LOCALE_C -DTEST_UNICODE tests.cpp parse.cpp regress.cpp
r6l.exe : tests.cpp parse.cpp regress.cpp
$(BCC32) -tWM- -tWR -D_NO_VCL $(CFLAGS) -er6l.exe -DBOOST_RE_TEST_LOCALE_CPP -DTEST_UNICODE tests.cpp parse.cpp regress.cpp
r1lm.exe : tests.cpp parse.cpp regress.cpp
$(BCC32) -tWM -tWR -D_NO_VCL $(CFLAGS) -er1lm.exe -DBOOST_RE_TEST_LOCALE_W32 tests.cpp parse.cpp regress.cpp
r2lm.exe : tests.cpp parse.cpp regress.cpp
$(BCC32) -tWM -tWR -D_NO_VCL $(CFLAGS) -er2lm.exe -DBOOST_RE_TEST_LOCALE_C tests.cpp parse.cpp regress.cpp
r3lm.exe : tests.cpp parse.cpp regress.cpp
$(BCC32) -tWM -tWR -D_NO_VCL $(CFLAGS) -er3lm.exe -DBOOST_RE_TEST_LOCALE_CPP tests.cpp parse.cpp regress.cpp
r4lm.exe : tests.cpp parse.cpp regress.cpp
$(BCC32) -tWM -tWR -D_NO_VCL $(CFLAGS) -er4lm.exe -DBOOST_RE_TEST_LOCALE_W32 -DTEST_UNICODE tests.cpp parse.cpp regress.cpp
r5lm.exe : tests.cpp parse.cpp regress.cpp
$(BCC32) -tWM -tWR -D_NO_VCL $(CFLAGS) -er5lm.exe -DBOOST_RE_TEST_LOCALE_C -DTEST_UNICODE tests.cpp parse.cpp regress.cpp
r6lm.exe : tests.cpp parse.cpp regress.cpp
$(BCC32) -tWM -tWR -D_NO_VCL $(CFLAGS) -er6lm.exe -DBOOST_RE_TEST_LOCALE_CPP -DTEST_UNICODE tests.cpp parse.cpp regress.cpp

View File

@ -1,186 +0,0 @@
# very basic makefile for regress
#
# Borland C++ tools
#
# BCROOT defines the root directory of your bcb install
#
!ifndef BCROOT
BCROOT=$(MAKEDIR)\..
!endif
BCC32 = $(BCROOT)\bin\Bcc32.exe
TLINK32 = $(BCROOT)\bin\ILink32.exe
IDE_LinkFLAGS32 = -L$(BCROOT)\LIB
LINKOPTS= -ap -Tpe -x
CFLAGS= -O2 -tWC -DSTRICT; -w-inl -w-aus -w-csu -w-eff -w-rch -I$(BCROOT)\include;..\..\..\..\; -L..\..\lib\bcb4
all :: r1.exe r2.exe r3.exe r4.exe r5.exe r6.exe r1m.exe r2m.exe r3m.exe r4m.exe r5m.exe r6m.exe r1v.exe r2v.exe r3v.exe r4v.exe r5v.exe r6v.exe r1l.exe r2l.exe r3l.exe r4l.exe r5l.exe r6l.exe r1lm.exe r2lm.exe r3lm.exe r4lm.exe r5lm.exe r6lm.exe r1lv.exe r2lv.exe r3lv.exe r4lv.exe r5lv.exe r6lv.exe
echo testing static single threaded version....
r1 tests.txt test1252.txt
r2 tests.txt
r3 tests.txt
r4 tests.txt test1252.txt
r5 tests.txt
r6 tests.txt
echo testing static multi-threaded version....
r1m tests.txt test1252.txt
r2m tests.txt
r3m tests.txt
r4m tests.txt test1252.txt
r5m tests.txt
r6m tests.txt
echo testing static VCL version....
r1v tests.txt test1252.txt
r2v tests.txt
r3v tests.txt
r4v tests.txt test1252.txt
r5v tests.txt
r6v tests.txt
echo testing dll single threaded version....
r1l tests.txt test1252.txt
r2l tests.txt
r3l tests.txt
r4l tests.txt test1252.txt
r5l tests.txt
r6l tests.txt
echo testing dll multi-threaded version....
r1lm tests.txt test1252.txt
r2lm tests.txt
r3lm tests.txt
r4lm tests.txt test1252.txt
r5lm tests.txt
r6lm tests.txt
echo testing dll VCL version....
r1lv tests.txt test1252.txt
r2lv tests.txt
r3lv tests.txt
r4lv tests.txt test1252.txt
r5lv tests.txt
r6lv tests.txt
r1.exe : tests.cpp regress.cpp parse.cpp
$(BCC32) -tWM- -D_NO_VCL $(CFLAGS) -er1.exe -DBOOST_RE_TEST_LOCALE_W32 tests.cpp regress.cpp parse.cpp
r2.exe : tests.cpp parse.cpp regress.cpp
$(BCC32) -tWM- -D_NO_VCL $(CFLAGS) -er2.exe -DBOOST_RE_TEST_LOCALE_C tests.cpp parse.cpp regress.cpp
r3.exe : tests.cpp parse.cpp regress.cpp
$(BCC32) -tWM- -D_NO_VCL $(CFLAGS) -er3.exe -DBOOST_RE_TEST_LOCALE_CPP tests.cpp parse.cpp regress.cpp
r4.exe : tests.cpp parse.cpp regress.cpp
$(BCC32) -tWM- -D_NO_VCL $(CFLAGS) -er4.exe -DBOOST_RE_TEST_LOCALE_W32 -DTEST_UNICODE tests.cpp parse.cpp regress.cpp
r5.exe : tests.cpp parse.cpp regress.cpp
$(BCC32) -tWM- -D_NO_VCL $(CFLAGS) -er5.exe -DBOOST_RE_TEST_LOCALE_C -DTEST_UNICODE tests.cpp parse.cpp regress.cpp
r6.exe : tests.cpp parse.cpp regress.cpp
$(BCC32) -tWM- -D_NO_VCL $(CFLAGS) -er6.exe -DBOOST_RE_TEST_LOCALE_CPP -DTEST_UNICODE tests.cpp parse.cpp regress.cpp
r1m.exe : tests.cpp parse.cpp regress.cpp
$(BCC32) -tWM -D_NO_VCL $(CFLAGS) -er1m.exe -DBOOST_RE_TEST_LOCALE_W32 tests.cpp parse.cpp regress.cpp
r2m.exe : tests.cpp parse.cpp regress.cpp
$(BCC32) -tWM -D_NO_VCL $(CFLAGS) -er2m.exe -DBOOST_RE_TEST_LOCALE_C tests.cpp parse.cpp regress.cpp
r3m.exe : tests.cpp parse.cpp regress.cpp
$(BCC32) -tWM -D_NO_VCL $(CFLAGS) -er3m.exe -DBOOST_RE_TEST_LOCALE_CPP tests.cpp parse.cpp regress.cpp
r4m.exe : tests.cpp parse.cpp regress.cpp
$(BCC32) -tWM -D_NO_VCL $(CFLAGS) -er4m.exe -DBOOST_RE_TEST_LOCALE_W32 -DTEST_UNICODE tests.cpp parse.cpp regress.cpp
r5m.exe : tests.cpp parse.cpp regress.cpp
$(BCC32) -tWM -D_NO_VCL $(CFLAGS) -er5m.exe -DBOOST_RE_TEST_LOCALE_C -DTEST_UNICODE tests.cpp parse.cpp regress.cpp
r6m.exe : tests.cpp parse.cpp regress.cpp
$(BCC32) -tWM -D_NO_VCL $(CFLAGS) -er6m.exe -DBOOST_RE_TEST_LOCALE_CPP -DTEST_UNICODE tests.cpp parse.cpp regress.cpp
r1v.exe : tests.cpp parse.cpp regress.cpp
$(BCC32) -tWM -tWV $(CFLAGS) -er1v.exe -DBOOST_RE_TEST_LOCALE_W32 tests.cpp parse.cpp regress.cpp
r2v.exe : tests.cpp parse.cpp regress.cpp
$(BCC32) -tWM -tWV $(CFLAGS) -er2v.exe -DBOOST_RE_TEST_LOCALE_C tests.cpp parse.cpp regress.cpp
r3v.exe : tests.cpp parse.cpp regress.cpp
$(BCC32) -tWM -tWV $(CFLAGS) -er3v.exe -DBOOST_RE_TEST_LOCALE_CPP tests.cpp parse.cpp regress.cpp
r4v.exe : tests.cpp parse.cpp regress.cpp
$(BCC32) -tWM -tWV $(CFLAGS) -er4v.exe -DBOOST_RE_TEST_LOCALE_W32 -DTEST_UNICODE tests.cpp parse.cpp regress.cpp
r5v.exe : tests.cpp parse.cpp regress.cpp
$(BCC32) -tWM -tWV $(CFLAGS) -er5v.exe -DBOOST_RE_TEST_LOCALE_C -DTEST_UNICODE tests.cpp parse.cpp regress.cpp
r6v.exe : tests.cpp parse.cpp regress.cpp
$(BCC32) -tWM -tWV $(CFLAGS) -er6v.exe -DBOOST_RE_TEST_LOCALE_CPP -DTEST_UNICODE tests.cpp parse.cpp regress.cpp
r1l.exe : tests.cpp parse.cpp regress.cpp
$(BCC32) -tWM- -tWR -D_NO_VCL $(CFLAGS) -er1l.exe -DBOOST_RE_TEST_LOCALE_W32 tests.cpp parse.cpp regress.cpp
r2l.exe : tests.cpp parse.cpp regress.cpp
$(BCC32) -tWM- -tWR -D_NO_VCL $(CFLAGS) -er2l.exe -DBOOST_RE_TEST_LOCALE_C tests.cpp parse.cpp regress.cpp
r3l.exe : tests.cpp parse.cpp regress.cpp
$(BCC32) -tWM- -tWR -D_NO_VCL $(CFLAGS) -er3l.exe -DBOOST_RE_TEST_LOCALE_CPP tests.cpp parse.cpp regress.cpp
r4l.exe : tests.cpp parse.cpp regress.cpp
$(BCC32) -tWM- -tWR -D_NO_VCL $(CFLAGS) -er4l.exe -DBOOST_RE_TEST_LOCALE_W32 -DTEST_UNICODE tests.cpp parse.cpp regress.cpp
r5l.exe : tests.cpp parse.cpp regress.cpp
$(BCC32) -tWM- -tWR -D_NO_VCL $(CFLAGS) -er5l.exe -DBOOST_RE_TEST_LOCALE_C -DTEST_UNICODE tests.cpp parse.cpp regress.cpp
r6l.exe : tests.cpp parse.cpp regress.cpp
$(BCC32) -tWM- -tWR -D_NO_VCL $(CFLAGS) -er6l.exe -DBOOST_RE_TEST_LOCALE_CPP -DTEST_UNICODE tests.cpp parse.cpp regress.cpp
r1lm.exe : tests.cpp parse.cpp regress.cpp
$(BCC32) -tWM -tWR -D_NO_VCL $(CFLAGS) -er1lm.exe -DBOOST_RE_TEST_LOCALE_W32 tests.cpp parse.cpp regress.cpp
r2lm.exe : tests.cpp parse.cpp regress.cpp
$(BCC32) -tWM -tWR -D_NO_VCL $(CFLAGS) -er2lm.exe -DBOOST_RE_TEST_LOCALE_C tests.cpp parse.cpp regress.cpp
r3lm.exe : tests.cpp parse.cpp regress.cpp
$(BCC32) -tWM -tWR -D_NO_VCL $(CFLAGS) -er3lm.exe -DBOOST_RE_TEST_LOCALE_CPP tests.cpp parse.cpp regress.cpp
r4lm.exe : tests.cpp parse.cpp regress.cpp
$(BCC32) -tWM -tWR -D_NO_VCL $(CFLAGS) -er4lm.exe -DBOOST_RE_TEST_LOCALE_W32 -DTEST_UNICODE tests.cpp parse.cpp regress.cpp
r5lm.exe : tests.cpp parse.cpp regress.cpp
$(BCC32) -tWM -tWR -D_NO_VCL $(CFLAGS) -er5lm.exe -DBOOST_RE_TEST_LOCALE_C -DTEST_UNICODE tests.cpp parse.cpp regress.cpp
r6lm.exe : tests.cpp parse.cpp regress.cpp
$(BCC32) -tWM -tWR -D_NO_VCL $(CFLAGS) -er6lm.exe -DBOOST_RE_TEST_LOCALE_CPP -DTEST_UNICODE tests.cpp parse.cpp regress.cpp
r1lv.exe : tests.cpp parse.cpp regress.cpp
$(BCC32) -tWM -tWR -tWV -tWC $(CFLAGS) -er1lv.exe -DBOOST_RE_TEST_LOCALE_W32 tests.cpp parse.cpp regress.cpp
r2lv.exe : tests.cpp parse.cpp regress.cpp
$(BCC32) -tWM -tWR -tWV -tWC $(CFLAGS) -er2lv.exe -DBOOST_RE_TEST_LOCALE_C tests.cpp parse.cpp regress.cpp
r3lv.exe : tests.cpp parse.cpp regress.cpp
$(BCC32) -tWM -tWR -tWV -tWC $(CFLAGS) -er3lv.exe -DBOOST_RE_TEST_LOCALE_CPP tests.cpp parse.cpp regress.cpp
r4lv.exe : tests.cpp parse.cpp regress.cpp
$(BCC32) -tWM -tWR -tWV -tWC $(CFLAGS) -er4lv.exe -DBOOST_RE_TEST_LOCALE_W32 -DTEST_UNICODE tests.cpp parse.cpp regress.cpp
r5lv.exe : tests.cpp parse.cpp regress.cpp
$(BCC32) -tWM -tWR -tWV -tWC $(CFLAGS) -er5lv.exe -DBOOST_RE_TEST_LOCALE_C -DTEST_UNICODE tests.cpp parse.cpp regress.cpp
r6lv.exe : tests.cpp parse.cpp regress.cpp
$(BCC32) -tWM -tWR -tWV -tWC $(CFLAGS) -er6lv.exe -DBOOST_RE_TEST_LOCALE_CPP -DTEST_UNICODE tests.cpp parse.cpp regress.cpp

View File

@ -1,186 +0,0 @@
# very basic makefile for regress
#
# Borland C++ tools
#
# BCROOT defines the root directory of your bcb install
#
!ifndef BCROOT
BCROOT=$(MAKEDIR)\..
!endif
BCC32 = $(BCROOT)\bin\Bcc32.exe
TLINK32 = $(BCROOT)\bin\ILink32.exe
IDE_LinkFLAGS32 = -L$(BCROOT)\LIB
LINKOPTS= -ap -Tpe -x
CFLAGS= -O2 -tWC -DSTRICT; -w-inl -w-aus -w-csu -w-eff -w-rch -I$(BCROOT)\include;..\..\..\..\; -L..\..\lib\bcb5
all :: r1.exe r2.exe r3.exe r4.exe r5.exe r6.exe r1m.exe r2m.exe r3m.exe r4m.exe r5m.exe r6m.exe r1v.exe r2v.exe r3v.exe r4v.exe r5v.exe r6v.exe r1l.exe r2l.exe r3l.exe r4l.exe r5l.exe r6l.exe r1lm.exe r2lm.exe r3lm.exe r4lm.exe r5lm.exe r6lm.exe r1lv.exe r2lv.exe r3lv.exe r4lv.exe r5lv.exe r6lv.exe
echo testing static single threaded version....
r1 tests.txt test1252.txt
r2 tests.txt
r3 tests.txt
r4 tests.txt test1252.txt
r5 tests.txt
r6 tests.txt
echo testing static multi-threaded version....
r1m tests.txt test1252.txt
r2m tests.txt
r3m tests.txt
r4m tests.txt test1252.txt
r5m tests.txt
r6m tests.txt
echo testing static VCL version....
r1v tests.txt test1252.txt
r2v tests.txt
r3v tests.txt
r4v tests.txt test1252.txt
r5v tests.txt
r6v tests.txt
echo testing dll single threaded version....
r1l tests.txt test1252.txt
r2l tests.txt
r3l tests.txt
r4l tests.txt test1252.txt
r5l tests.txt
r6l tests.txt
echo testing dll multi-threaded version....
r1lm tests.txt test1252.txt
r2lm tests.txt
r3lm tests.txt
r4lm tests.txt test1252.txt
r5lm tests.txt
r6lm tests.txt
echo testing dll VCL version....
r1lv tests.txt test1252.txt
r2lv tests.txt
r3lv tests.txt
r4lv tests.txt test1252.txt
r5lv tests.txt
r6lv tests.txt
r1.exe : tests.cpp regress.cpp parse.cpp
$(BCC32) -tWM- -D_NO_VCL $(CFLAGS) -er1.exe -DBOOST_RE_TEST_LOCALE_W32 tests.cpp regress.cpp parse.cpp
r2.exe : tests.cpp parse.cpp regress.cpp
$(BCC32) -tWM- -D_NO_VCL $(CFLAGS) -er2.exe -DBOOST_RE_TEST_LOCALE_C tests.cpp parse.cpp regress.cpp
r3.exe : tests.cpp parse.cpp regress.cpp
$(BCC32) -tWM- -D_NO_VCL $(CFLAGS) -er3.exe -DBOOST_RE_TEST_LOCALE_CPP tests.cpp parse.cpp regress.cpp
r4.exe : tests.cpp parse.cpp regress.cpp
$(BCC32) -tWM- -D_NO_VCL $(CFLAGS) -er4.exe -DBOOST_RE_TEST_LOCALE_W32 -DTEST_UNICODE tests.cpp parse.cpp regress.cpp
r5.exe : tests.cpp parse.cpp regress.cpp
$(BCC32) -tWM- -D_NO_VCL $(CFLAGS) -er5.exe -DBOOST_RE_TEST_LOCALE_C -DTEST_UNICODE tests.cpp parse.cpp regress.cpp
r6.exe : tests.cpp parse.cpp regress.cpp
$(BCC32) -tWM- -D_NO_VCL $(CFLAGS) -er6.exe -DBOOST_RE_TEST_LOCALE_CPP -DTEST_UNICODE tests.cpp parse.cpp regress.cpp
r1m.exe : tests.cpp regress.cpp parse.cpp
$(BCC32) -tWM -D_NO_VCL $(CFLAGS) -er1m.exe -DBOOST_RE_TEST_LOCALE_W32 tests.cpp regress.cpp parse.cpp
r2m.exe : tests.cpp parse.cpp regress.cpp
$(BCC32) -tWM -D_NO_VCL $(CFLAGS) -er2m.exe -DBOOST_RE_TEST_LOCALE_C tests.cpp parse.cpp regress.cpp
r3m.exe : tests.cpp parse.cpp regress.cpp
$(BCC32) -tWM -D_NO_VCL $(CFLAGS) -er3m.exe -DBOOST_RE_TEST_LOCALE_CPP tests.cpp parse.cpp regress.cpp
r4m.exe : tests.cpp parse.cpp regress.cpp
$(BCC32) -tWM -D_NO_VCL $(CFLAGS) -er4m.exe -DBOOST_RE_TEST_LOCALE_W32 -DTEST_UNICODE tests.cpp parse.cpp regress.cpp
r5m.exe : tests.cpp parse.cpp regress.cpp
$(BCC32) -tWM -D_NO_VCL $(CFLAGS) -er5m.exe -DBOOST_RE_TEST_LOCALE_C -DTEST_UNICODE tests.cpp parse.cpp regress.cpp
r6m.exe : tests.cpp parse.cpp regress.cpp
$(BCC32) -tWM -D_NO_VCL $(CFLAGS) -er6m.exe -DBOOST_RE_TEST_LOCALE_CPP -DTEST_UNICODE tests.cpp parse.cpp regress.cpp
r1v.exe : tests.cpp regress.cpp parse.cpp
$(BCC32) -tWM -tWV $(CFLAGS) -er1v.exe -DBOOST_RE_TEST_LOCALE_W32 tests.cpp regress.cpp parse.cpp
r2v.exe : tests.cpp parse.cpp regress.cpp
$(BCC32) -tWM -tWV $(CFLAGS) -er2v.exe -DBOOST_RE_TEST_LOCALE_C tests.cpp parse.cpp regress.cpp
r3v.exe : tests.cpp parse.cpp regress.cpp
$(BCC32) -tWM -tWV $(CFLAGS) -er3v.exe -DBOOST_RE_TEST_LOCALE_CPP tests.cpp parse.cpp regress.cpp
r4v.exe : tests.cpp parse.cpp regress.cpp
$(BCC32) -tWM -tWV $(CFLAGS) -er4v.exe -DBOOST_RE_TEST_LOCALE_W32 -DTEST_UNICODE tests.cpp parse.cpp regress.cpp
r5v.exe : tests.cpp parse.cpp regress.cpp
$(BCC32) -tWM -tWV $(CFLAGS) -er5v.exe -DBOOST_RE_TEST_LOCALE_C -DTEST_UNICODE tests.cpp parse.cpp regress.cpp
r6v.exe : tests.cpp parse.cpp regress.cpp
$(BCC32) -tWM -tWV $(CFLAGS) -er6v.exe -DBOOST_RE_TEST_LOCALE_CPP -DTEST_UNICODE tests.cpp parse.cpp regress.cpp
r1l.exe : tests.cpp regress.cpp parse.cpp
$(BCC32) -tWM- -tWR -D_NO_VCL $(CFLAGS) -er1l.exe -DBOOST_RE_TEST_LOCALE_W32 tests.cpp regress.cpp parse.cpp
r2l.exe : tests.cpp parse.cpp regress.cpp
$(BCC32) -tWM- -tWR -D_NO_VCL $(CFLAGS) -er2l.exe -DBOOST_RE_TEST_LOCALE_C tests.cpp parse.cpp regress.cpp
r3l.exe : tests.cpp parse.cpp regress.cpp
$(BCC32) -tWM- -tWR -D_NO_VCL $(CFLAGS) -er3l.exe -DBOOST_RE_TEST_LOCALE_CPP tests.cpp parse.cpp regress.cpp
r4l.exe : tests.cpp parse.cpp regress.cpp
$(BCC32) -tWM- -tWR -D_NO_VCL $(CFLAGS) -er4l.exe -DBOOST_RE_TEST_LOCALE_W32 -DTEST_UNICODE tests.cpp parse.cpp regress.cpp
r5l.exe : tests.cpp parse.cpp regress.cpp
$(BCC32) -tWM- -tWR -D_NO_VCL $(CFLAGS) -er5l.exe -DBOOST_RE_TEST_LOCALE_C -DTEST_UNICODE tests.cpp parse.cpp regress.cpp
r6l.exe : tests.cpp parse.cpp regress.cpp
$(BCC32) -tWM- -tWR -D_NO_VCL $(CFLAGS) -er6l.exe -DBOOST_RE_TEST_LOCALE_CPP -DTEST_UNICODE tests.cpp parse.cpp regress.cpp
r1lm.exe : tests.cpp regress.cpp parse.cpp
$(BCC32) -tWM -tWR -D_NO_VCL $(CFLAGS) -er1lm.exe -DBOOST_RE_TEST_LOCALE_W32 tests.cpp regress.cpp parse.cpp
r2lm.exe : tests.cpp parse.cpp regress.cpp
$(BCC32) -tWM -tWR -D_NO_VCL $(CFLAGS) -er2lm.exe -DBOOST_RE_TEST_LOCALE_C tests.cpp parse.cpp regress.cpp
r3lm.exe : tests.cpp parse.cpp regress.cpp
$(BCC32) -tWM -tWR -D_NO_VCL $(CFLAGS) -er3lm.exe -DBOOST_RE_TEST_LOCALE_CPP tests.cpp parse.cpp regress.cpp
r4lm.exe : tests.cpp parse.cpp regress.cpp
$(BCC32) -tWM -tWR -D_NO_VCL $(CFLAGS) -er4lm.exe -DBOOST_RE_TEST_LOCALE_W32 -DTEST_UNICODE tests.cpp parse.cpp regress.cpp
r5lm.exe : tests.cpp parse.cpp regress.cpp
$(BCC32) -tWM -tWR -D_NO_VCL $(CFLAGS) -er5lm.exe -DBOOST_RE_TEST_LOCALE_C -DTEST_UNICODE tests.cpp parse.cpp regress.cpp
r6lm.exe : tests.cpp parse.cpp regress.cpp
$(BCC32) -tWM -tWR -D_NO_VCL $(CFLAGS) -er6lm.exe -DBOOST_RE_TEST_LOCALE_CPP -DTEST_UNICODE tests.cpp parse.cpp regress.cpp
r1lv.exe : tests.cpp regress.cpp parse.cpp
$(BCC32) -tWM -tWR -tWV -tWC $(CFLAGS) -er1lv.exe -DBOOST_RE_TEST_LOCALE_W32 tests.cpp regress.cpp parse.cpp
r2lv.exe : tests.cpp parse.cpp regress.cpp
$(BCC32) -tWM -tWR -tWV -tWC $(CFLAGS) -er2lv.exe -DBOOST_RE_TEST_LOCALE_C tests.cpp parse.cpp regress.cpp
r3lv.exe : tests.cpp parse.cpp regress.cpp
$(BCC32) -tWM -tWR -tWV -tWC $(CFLAGS) -er3lv.exe -DBOOST_RE_TEST_LOCALE_CPP tests.cpp parse.cpp regress.cpp
r4lv.exe : tests.cpp parse.cpp regress.cpp
$(BCC32) -tWM -tWR -tWV -tWC $(CFLAGS) -er4lv.exe -DBOOST_RE_TEST_LOCALE_W32 -DTEST_UNICODE tests.cpp parse.cpp regress.cpp
r5lv.exe : tests.cpp parse.cpp regress.cpp
$(BCC32) -tWM -tWR -tWV -tWC $(CFLAGS) -er5lv.exe -DBOOST_RE_TEST_LOCALE_C -DTEST_UNICODE tests.cpp parse.cpp regress.cpp
r6lv.exe : tests.cpp parse.cpp regress.cpp
$(BCC32) -tWM -tWR -tWV -tWC $(CFLAGS) -er6lv.exe -DBOOST_RE_TEST_LOCALE_CPP -DTEST_UNICODE tests.cpp parse.cpp regress.cpp

View File

@ -1,54 +0,0 @@
# very basic makefile for regression tests
#
# g++ 2.95 and greater
#
CXX= g++ -pedantic -Wall -I../../../../ -I./ -L../../lib/gcc
total : r2
./r2 tests.txt
r2 : tests.cpp parse.cpp regress.cpp
$(CXX) -O2 -o r2 tests.cpp parse.cpp regress.cpp -lregex++
debug : tests.cpp parse.cpp regress.cpp
$(CXX) -g -o r2 tests.cpp parse.cpp regress.cpp -lregex++debug

View File

@ -1,46 +0,0 @@
# very basic makefile for regression tests
#
CXX=@CXX@
CXXFLAGS=@CXXFLAGS@ -I../../../../
LIBS=@LIBS@ -L../../lib -lregex++
EXE=@ac_exe_ext@
OBJ=@ac_obj_ext@
total : @ac_regress@
LIBDEP=../../lib/libregex++.a ../../../../boost/re_detail/regex_options.hpp ../../../../boost/re_detail/regex_config.hpp
r1$(EXE) :: tests.cpp parse.cpp regress.cpp
$(CXX) -o r1$(EXE) $(CXXFLAGS) tests.cpp parse.cpp regress.cpp $(LIBS)
./r1 tests.txt
r2$(EXE) :: tests.cpp parse.cpp regress.cpp
$(CXX) -o r2$(EXE) $(CXXFLAGS) -DTEST_UNICODE tests.cpp parse.cpp regress.cpp $(LIBS)
./r2 tests.txt

View File

@ -1,327 +0,0 @@
/*
*
* Copyright (c) 1998-2000
* Dr John Maddock
*
* Permission to use, copy, modify, distribute and sell this software
* and its documentation for any purpose is hereby granted without fee,
* provided that the above copyright notice appear in all copies and
* that both that copyright notice and this permission notice appear
* in supporting documentation. Dr John Maddock makes no representations
* about the suitability of this software for any purpose.
* It is provided "as is" without express or implied warranty.
*
*/
/*
*
* FILE parse.cpp
* VERSION 3.03
*
* Input parsing functions for regress.
*
*/
#include <boost/regex.hpp>
#include "regress.h"
#ifndef BOOST_RE_ALGO_INCLUDED
#include <algorithm>
#endif
using namespace boost;
//
// start by defining all our flag types:
flag_info flag_data[] = {
{ BOOST_RE_STR("REG_BASIC"), 9, REG_BASIC, 0 },
{ BOOST_RE_STR("REG_EXTENDED"), 12, REG_EXTENDED, 0 },
{ BOOST_RE_STR("REG_ICASE"), 9, REG_ICASE, 0 },
{ BOOST_RE_STR("REG_NOSUB"), 9, REG_NOSUB, 0 },
{ BOOST_RE_STR("REG_NEWLINE"), 11, REG_NEWLINE, 0 },
{ BOOST_RE_STR("REG_NEWLINE"), 11, REG_NEWLINE, 0 },
{ BOOST_RE_STR("REG_NOSPEC"), 10, REG_NOSPEC, 0 },
{ BOOST_RE_STR("REG_NOTBOL"), 10, REG_NOTBOL, 1 },
{ BOOST_RE_STR("REG_NOTEOL"), 10, REG_NOTEOL, 1 },
{ BOOST_RE_STR("REG_STARTEND"), 12, REG_STARTEND, 1 },
{ BOOST_RE_STR("basic"), 5, regbase::basic, 2 },
{ BOOST_RE_STR("escape_in_lists"), 15, regbase::escape_in_lists, 2 },
{ BOOST_RE_STR("char_classes"), 12, regbase::char_classes, 2 },
{ BOOST_RE_STR("intervals"), 9, regbase::intervals, 2 },
{ BOOST_RE_STR("limited_ops"), 11, regbase::limited_ops, 2 },
{ BOOST_RE_STR("newline_alt"), 11, regbase::newline_alt, 2 },
{ BOOST_RE_STR("bk_plus_qm"), 10, regbase::bk_plus_qm, 2 },
{ BOOST_RE_STR("bk_braces"), 9, regbase::bk_braces, 2 },
{ BOOST_RE_STR("bk_parens"), 9, regbase::bk_parens, 2 },
{ BOOST_RE_STR("bk_refs"), 7, regbase::bk_refs, 2 },
{ BOOST_RE_STR("bk_vbar"), 7, regbase::bk_vbar, 2 },
{ BOOST_RE_STR("use_except"), 10, regbase::use_except, 2 },
{ BOOST_RE_STR("literal"), 7, regbase::literal, 2 },
{ BOOST_RE_STR("normal"), 6, regbase::normal, 2 },
{ BOOST_RE_STR("basic"), 5, regbase::basic, 2 },
{ BOOST_RE_STR("extended"), 8, regbase::extended, 2 },
{ BOOST_RE_STR("match_default"), 13, match_default, 3 },
{ BOOST_RE_STR("match_not_bol"), 13, match_not_bol, 3 },
{ BOOST_RE_STR("match_not_eol"), 13, match_not_eol, 3 },
{ BOOST_RE_STR("match_not_bob"), 13, match_not_bob, 3 },
{ BOOST_RE_STR("match_not_eob"), 13, match_not_eob, 3 },
{ BOOST_RE_STR("match_not_bow"), 13, match_not_bow, 3 },
{ BOOST_RE_STR("match_not_eow"), 13, match_not_eow, 3 },
{ BOOST_RE_STR("match_not_dot_newline"), 21, match_not_dot_newline, 3 },
{ BOOST_RE_STR("match_not_dot_null"), 18, match_not_dot_null, 3 },
{ BOOST_RE_STR("match_prev_avail"), 16, match_prev_avail, 3 },
{ BOOST_RE_STR("match_any"), 9, match_any, 3 },
{ BOOST_RE_STR("match_not_null"), 14, match_not_null, 3 },
{ BOOST_RE_STR("match_continuous"), 16, match_continuous, 3 },
{ BOOST_RE_STR("match_partial"), 13, match_partial, 3 },
{ BOOST_RE_STR("format_sed"), 10, format_sed, 3 },
{ BOOST_RE_STR("format_perl"), 11, format_perl, 3 },
{ BOOST_RE_STR("format_no_copy"), 14, format_no_copy, 3 },
{ BOOST_RE_STR("REG_NO_POSIX_TEST"), 17, REG_NO_POSIX_TEST, 4 },
{ BOOST_RE_STR("REG_UNICODE_ONLY"), 16, REG_UNICODE_ONLY, 4 },
{ BOOST_RE_STR("REG_GREP"), 8, REG_GREP, 4 },
{ BOOST_RE_STR("REG_MERGE"), 9, REG_MERGE, 4 },
{ BOOST_RE_STR("REG_MERGE_COPY"), 14, REG_MERGE_COPY, 4 },
{ BOOST_RE_STR(""), 0, 0, 0 },
};
// basically we create a simple token parser
// using regular expressions
const char_t* expression_text = BOOST_RE_STR("(;.*)|") // comment
BOOST_RE_STR("(^[[:blank:]]*-)|") // -
BOOST_RE_STR("([^\"[:space:]][^[:space:]]*)|") // token
BOOST_RE_STR("(\"(([^\"]|\\\\\")*)\")") // "token"
;
typedef reg_expression<char_t> re_parse_t;
typedef re_parse_t::allocator_type parse_alloc;
typedef match_results<string_type::const_iterator, parse_alloc> parse_grep;
typedef string_type::const_iterator parse_iterator;
re_parse_t parse_expression(expression_text, regbase::normal);
//
// now define our grep predicate function object:
class parse_function
{
int mode;
public:
parse_function() : mode(0) {}
parse_function(const parse_function& o) : mode(o.mode) {}
bool operator()(const parse_grep& i);
};
bool parse_function::operator()(const parse_grep& g)
{
parse_iterator i, j;
// determine what caused the match:
if(g[1].matched)
{
// we have a comment:
return true;
}
else if(g[2].matched)
{
// we have the start of a line of flags
mode = -1;
for(int i = 0; i < 5; ++i)
flags[i] = 0;
return true;
}
else if(g[3].matched)
{
// token:
i = g[3].first;
j = g[3].second;
}
else
{
// token delimited by ""
i = g[5].first;
j = g[5].second;
}
// now we need to switch depending upon what mode we are in:
switch(mode)
{
case -1:
{
// parse the flag:
unsigned int id = 0;
while(flag_data[id].len != 0)
{
if(static_cast<unsigned int>(j - i) != flag_data[id].len)
{
++id;
continue;
}
if(std::equal(i, j, flag_data[id].name) == true)
{
flags[flag_data[id].id] |= flag_data[id].value;
return true;
}
++id;
}
cout << "Warning: Unknown flag: ";
string_type t(i, j);
cout << t.c_str();
cout << endl;
return true;
}
case 0:
// set the expression text:
expression = string_type(i, j);
do_test = true;
break;
case 1:
// set the text to match:
search_text = string_type(i, j);
jm_trace("Initial search text: " << search_text);
expand_escapes(search_text);
jm_trace("Search text after escapes expanded: " << search_text);
break;
case 2:
// maybe set format string:
if(flags[4] & REG_MERGE)
{
format_string = string_type(i, j);
break;
}
else
{
matches[mode - 2] = to_int(i, j);
break;
}
case 3:
// maybe set format result:
if(flags[4] & REG_MERGE)
{
merge_string = string_type(i, j);
expand_escapes(merge_string);
break;
}
else
{
matches[mode - 2] = to_int(i, j);
break;
}
default:
jm_assert(mode >= 2);
// set the relevent int value:
matches[mode - 2] = to_int(i, j);
}
++mode;
return true;
}
void parse_input_line(const string_type& s)
{
// set matches back to starting values:
for(int i = 0; i < MAX_MATCHES; ++i)
{
matches[i] = -2;
}
parse_function op;
do_test = false;
regex_grep(op, s.begin(), s.end(), parse_expression);
jm_trace("expression: " << expression);
jm_trace("search string: " << search_text);
}
int to_int(string_type::const_iterator i, string_type::const_iterator j)
{
int val = 0;
bool neg = false;
if((i != j) && (*i == BOOST_RE_STR('-')))
{
neg = true;
++i;
}
while (i != j)
{
val *= 10;
val += *i - BOOST_RE_STR('0');
++i;
}
if(neg)
val *= -1;
return val;
}
void expand_escapes(string_type& s)
{
for(unsigned int i = 0; i < s.size(); ++i)
{
if(s[i] == BOOST_RE_STR('\\'))
{
switch(s[i+1])
{
case BOOST_RE_STR('a'):
s.erase(s.begin() + i);
s[i] = BOOST_RE_STR('\a');
break;
case BOOST_RE_STR('b'):
s.erase(s.begin() + i);
s[i] = BOOST_RE_STR('\b');
break;
case BOOST_RE_STR('f'):
s.erase(s.begin() + i);
s[i] = BOOST_RE_STR('\f');
break;
case BOOST_RE_STR('n'):
s.erase(s.begin() + i);
s[i] = BOOST_RE_STR('\n');
break;
case BOOST_RE_STR('r'):
s.erase(s.begin() + i);
s[i] = BOOST_RE_STR('\r');
break;
case BOOST_RE_STR('t'):
s.erase(s.begin() + i);
s[i] = BOOST_RE_STR('\t');
break;
case BOOST_RE_STR('v'):
s.erase(s.begin() + i);
s[i] = BOOST_RE_STR('\v');
break;
default:
if( (s[i + 1] >= BOOST_RE_STR('0')) && (s[i + 1] <= BOOST_RE_STR('9')) )
{
int val = 0;
unsigned int pos = i;
++i;
while((i < s.size()) && (s[i] >= BOOST_RE_STR('0')) && (s[i] <= BOOST_RE_STR('9')))
{
val *= 10;
val += s[i] - BOOST_RE_STR('0');
++i;
}
s.erase(s.begin() + pos, s.begin() + i);
if(0 == val)
{
s.insert(s.begin()+pos, ' ');
s[pos] = 0;
}
else
s.insert(s.begin() + pos, (string_type::value_type)val);
i = pos;
}
else
{
s.erase(s.begin() + i);
}
}
}
}
}

View File

@ -1,200 +0,0 @@
/*
*
* Copyright (c) 1998-2000
* Dr John Maddock
*
* Permission to use, copy, modify, distribute and sell this software
* and its documentation for any purpose is hereby granted without fee,
* provided that the above copyright notice appear in all copies and
* that both that copyright notice and this permission notice appear
* in supporting documentation. Dr John Maddock makes no representations
* about the suitability of this software for any purpose.
* It is provided "as is" without express or implied warranty.
*
*/
/*
* LOCATION: see http://www.boost.org for most recent version.
* FILE regex_test.cpp
* VERSION 3.03
* DESCRIPTION: Builds regression test program with default
* locale and narrow character tests. Also
* instantiates all the templates in the library
* as a sanity check.
*/
// disable automatic selection of support library:
#define BOOST_RE_NO_LIB
#include <boost/regex.hpp>
//
// instantiate templates used:
//
namespace boost{
#if defined(__GNUC__) && defined(__BEOS__)
#define ra_it const char*
#define test_char_type char
#else
typedef const char* ra_it;
typedef char test_char_type;
#endif
typedef std::basic_string<test_char_type> test_string_type;
bool pred1(const match_results<ra_it>&)
{ return true; }
typedef bool (*pred1_type)(const match_results<ra_it>&);
typedef bool (*pred2_type)(const match_results<test_string_type::const_iterator>&);
//check that all the defined flags are available:
regbase::flag_type f = regbase::escape_in_lists | regbase::char_classes | regbase::intervals | regbase::limited_ops
| regbase::newline_alt | regbase::bk_plus_qm | regbase::bk_braces
| regbase::bk_parens | regbase::bk_refs | regbase::bk_vbar | regbase::use_except
| regbase::failbit | regbase::literal | regbase::icase | regbase::nocollate | regbase::basic
| regbase::extended | regbase::normal | regbase::emacs | regbase::awk | regbase::grep | regbase::egrep | regbase::sed;
template class reg_expression<test_char_type>;
template struct sub_match<ra_it>;
template class match_results<ra_it>;
template bool regex_match(ra_it,
ra_it,
match_results<ra_it>& m,
const reg_expression<test_char_type>& e,
unsigned flags);
template bool regex_match(ra_it,
ra_it,
const reg_expression<test_char_type>& e,
unsigned flags);
template bool regex_search(ra_it,
ra_it,
match_results<ra_it>& m,
const reg_expression<test_char_type>& e,
unsigned flags);
template unsigned int regex_grep(pred1_type,
ra_it,
ra_it,
const reg_expression<test_char_type>& e,
unsigned flags);
template test_char_type* regex_format(test_char_type*,
const match_results<ra_it>& m,
const test_char_type* fmt,
unsigned flags);
template test_char_type* regex_format(test_char_type*,
const match_results<ra_it>& m,
const test_string_type& fmt,
unsigned flags);
template test_char_type* regex_merge(test_char_type*,
ra_it,
ra_it,
const reg_expression<test_char_type>&,
const test_char_type*,
unsigned int flags);
template test_char_type* regex_merge(test_char_type*,
ra_it,
ra_it,
const reg_expression<test_char_type>& e,
const test_string_type&,
unsigned int flags);
template std::size_t regex_split(test_string_type*,
test_string_type&,
const reg_expression<test_char_type>&,
unsigned flags,
std::size_t);
template std::size_t regex_split(test_string_type*,
test_string_type& s,
const reg_expression<test_char_type>& e,
unsigned flags);
template std::size_t regex_split(test_string_type*, test_string_type&);
#ifndef BOOST_RE_NO_PARTIAL_FUNC_SPEC
//
// the following prototypes are only available if partial ordering
// of template functions is supported:
//
template bool regex_match(const test_char_type*,
match_results<const test_char_type*>& m,
const reg_expression<test_char_type>& e,
unsigned flags);
template bool regex_match(const test_string_type&,
match_results<test_string_type::const_iterator>&,
const reg_expression<test_char_type>&,
unsigned flags);
template bool regex_match(const test_char_type*,
const reg_expression<test_char_type>&,
unsigned flags);
template bool regex_match(const test_string_type&,
const reg_expression<test_char_type>&,
unsigned flags);
template bool regex_search(const test_char_type*,
match_results<const test_char_type*>&,
const reg_expression<test_char_type>&,
unsigned flags);
template bool regex_search(const test_string_type&,
match_results<test_string_type::const_iterator>&,
const reg_expression<test_char_type>&,
unsigned flags);
template unsigned int regex_grep(pred1_type,
const test_char_type*,
const reg_expression<test_char_type>&,
unsigned flags);
template unsigned int regex_grep(pred2_type,
const test_string_type&,
const reg_expression<test_char_type>&,
unsigned flags);
template test_string_type regex_format
(const match_results<test_string_type::const_iterator>& m,
const test_char_type*,
unsigned flags);
template test_string_type regex_format
(const match_results<test_string_type::const_iterator>&,
const test_string_type&,
unsigned flags);
template test_string_type regex_merge(const test_string_type&,
const reg_expression<test_char_type>&,
const test_char_type*,
unsigned int flags);
template test_string_type regex_merge(const test_string_type&,
const reg_expression<test_char_type>&,
const test_string_type&,
unsigned int flags);
#endif
} // namespace boost
//
// include regression test source files:
//
#ifdef BOOST_RE_LOCALE_W32
#define BOOST_RE_TEST_LOCALE_W32
#elif !defined(BOOST_RE_LOCALE_C)
#define BOOST_RE_TEST_LOCALE_CPP
#endif
#include "tests.cpp"
#include "parse.cpp"
#include "regress.cpp"
//
// include library source files:
//
#ifdef BOOST_RE_LOCALE_W32
#include "libs/regex/src/w32_regex_traits.cpp"
#elif defined(BOOST_RE_LOCALE_C)
#include "libs/regex/src/c_regex_traits.cpp"
#else
#include "libs/regex/src/cpp_regex_traits.cpp"
#endif
#include "libs/regex/src/c_regex_traits_common.cpp"
#include "libs/regex/src/cregex.cpp"
#include "libs/regex/src/fileiter.cpp"
#include "libs/regex/src/posix_api.cpp"
#include "libs/regex/src/regex.cpp"
#include "libs/regex/src/regex_debug.cpp"
#include "libs/regex/src/regex_synch.cpp"

View File

@ -1,259 +0,0 @@
/*
*
* Copyright (c) 1998-2000
* Dr John Maddock
*
* Permission to use, copy, modify, distribute and sell this software
* and its documentation for any purpose is hereby granted without fee,
* provided that the above copyright notice appear in all copies and
* that both that copyright notice and this permission notice appear
* in supporting documentation. Dr John Maddock makes no representations
* about the suitability of this software for any purpose.
* It is provided "as is" without express or implied warranty.
*
*/
/*
*
* FILE regress.cpp
* VERSION 3.03
*
* main() and associated code for regress.
*
*/
#include <cstdlib>
#include <boost/regex.hpp>
#ifdef BOOST_RE_OLD_IOSTREAM
#include <fstream.h>
#else
#include <fstream>
using std::ifstream;
using std::ofstream;
//using std::cin;
//using std::cout;
using std::endl;
#endif
#ifdef __BORLANDC__
#pragma hrdstop
#endif
#include "regress.h"
#if defined(BOOST_MSVC) && defined(_DEBUG)
#include <CRTDBG.H>
#endif
//
// declare all our globals here:
//
string_type expression;
string_type search_text;
string_type format_string;
string_type merge_string;
int matches[MAX_MATCHES];
char file[MAX_PATH];
int line;
bool do_test = false;
unsigned int flags[5];
unsigned error_count = 0;
void usage()
{
cout <<
"Usage: regress filename [filename2...]\n"
"see tests.txt for an example test script\n"
"and the script format.\n";
}
int main(int argc, char * argv[])
{
#if defined(BOOST_MSVC) && defined(_DEBUG)
// turn on heap reporting at program exit:
int tmpFlag = _CrtSetDbgFlag( _CRTDBG_REPORT_FLAG );
tmpFlag |= _CRTDBG_LEAK_CHECK_DF;
tmpFlag &= ~_CRTDBG_CHECK_CRT_DF;
_CrtSetDbgFlag( tmpFlag );
#endif
if(argc < 2)
usage();
int i;
for(i = 1; i < argc; ++i)
{
reset_error();
ifstream is(argv[i]);
if(is.good() == false)
{
cout << "Error unable to open file: " << argv[i] << endl << endl;
return -1;
}
std::strcpy(file, argv[i]);
line = 0;
unsigned int tests = 0;
while(is.good())
{
string_type s;
get_line(is, s);
++line;
jm_trace("Reading test script line " << line << " " << s);
parse_input_line(s);
if(do_test)
{
run_tests();
++tests;
}
}
cout << line << " lines, " << tests << " tests completed in file " << argv[i] << endl;
}
return error_count;
}
#ifdef TEST_UNICODE
ostream& operator << (ostream& os, const wchar_t* s)
{
while(*s)
{
os.put((char)*s);
++s;
}
return os;
}
ostream& operator << (ostream& os, const std::wstring& s)
{
os << s.c_str();
return os;
}
istream& get_line(istream& is, nstring_type& s, char delim)
{
char c = (char)is.get();
s.erase(s.begin(), s.end());
while((c != delim) && is.good())
{
s.append(1, c);
c = (char)is.get();
}
return is;
}
istream& get_line(istream& is, string_type& s, char delim)
{
nstring_type t;
get_line(is, t, delim);
s.erase(s.begin(), s.end());
const char* i, *j;
i = t.c_str();
j = t.c_str() + t.size();
wchar_t* buf = new wchar_t[MB_CUR_MAX + 1];
int cchars;
while(i != j)
{
cchars = mbtowc(buf, i, j - i);
if(cchars == -1)
break;
if(cchars == 0)
break;
s.insert(s.end(), buf, buf + cchars);
i += cchars;
}
delete[] buf;
return is;
}
#else
istream& get_line(istream& is, string_type& s, char delim)
{
char c = (char)is.get();
s.erase(s.begin(), s.end());
while((c != delim) && is.good())
{
s.append(1, c);
c = (char)is.get();
}
return is;
}
#endif
jm_debug_alloc::jm_debug_alloc()
{
blocks = new int;
count = new int;
*blocks = 0;
*count = 1;
guard = this;
}
jm_debug_alloc::jm_debug_alloc(const jm_debug_alloc& d)
{
blocks = d.blocks;
count = d.count;
++(*count);
guard = this;
}
jm_debug_alloc& jm_debug_alloc::operator=(const jm_debug_alloc& d)
{
free_();
blocks = d.blocks;
count = d.count;
++(*count);
return *this;
}
jm_debug_alloc::~jm_debug_alloc()
{
if(guard != this)
{
cout << "Error: attempt to destroy object already destroyed" << endl;
}
else
{
free_();
guard = 0;
}
}
void jm_debug_alloc::free_()
{
if(--(*count) == 0)
{
if(*blocks)
{
begin_error();
cout << "Error: " << *blocks << " blocks not freed by allocator" << endl;
}
delete count;
delete blocks;
}
}
jm_debug_alloc::pointer jm_debug_alloc::allocate(size_type n, void*)
{
pointer p = new char[n + maxi(sizeof(size_type), boost::re_detail::padding_size)];
*(size_type*)p = n;
++(*blocks);
return p + maxi(sizeof(size_type), boost::re_detail::padding_size);
}
void jm_debug_alloc::deallocate(pointer p, size_type n)
{
p -= maxi(sizeof(size_type), boost::re_detail::padding_size);
if(*(size_type*)p != n)
{
begin_error();
cout << "Error: size mismatch in allocate/deallocate calls" << endl;
}
--(*blocks);
delete[] p;
}

View File

@ -1,336 +0,0 @@
/*
*
* Copyright (c) 1998-2000
* Dr John Maddock
*
* Permission to use, copy, modify, distribute and sell this software
* and its documentation for any purpose is hereby granted without fee,
* provided that the above copyright notice appear in all copies and
* that both that copyright notice and this permission notice appear
* in supporting documentation. Dr John Maddock makes no representations
* about the suitability of this software for any purpose.
* It is provided "as is" without express or implied warranty.
*
*/
/*
*
* FILE regress.h
* VERSION 3.03
*
* Function and data declarations for regress.
*
*/
#ifndef _REGRESS_H
#define _REGRESS_H
#include <boost/re_detail/regex_config.hpp>
#ifdef BOOST_RE_OLD_IOSTREAM
#include <iostream.h>
#else
#include <iostream>
using std::cout;
using std::cerr;
using std::cin;
using std::istream;
using std::ostream;
using std::endl;
#endif
#include <string>
#include <iostream>
#include <boost/regex.hpp>
#if defined(TEST_UNICODE)
#ifdef __GNUC__
#define char_t wchar_t
#else
typedef wchar_t char_t;
#endif
#define NO_POSIX_TEST
typedef std::basic_string<char_t> string_type;
typedef std::basic_string<char> nstring_type;
inline istream& get_line(istream& is, nstring_type& s, char delim = '\n');
istream& get_line(istream& is, string_type& s, char delim = L'\n');
#define BOOST_RE_STR(x) L##x
ostream& operator << (ostream& os, const string_type& s);
#else
#ifdef __GNUC__
#define char_t char
#else
typedef char char_t;
#endif
typedef std::basic_string<char_t> string_type;
inline istream& get_line(istream& is, string_type& s, char delim = '\n');
#define BOOST_RE_STR(x) x
#endif
ostream& operator << (ostream& os, const wchar_t* s);
void parse_input_line(const string_type& s);
void expand_escapes(string_type& s);
void run_tests();
void begin_error();
void reset_error();
int to_int(string_type::const_iterator i, string_type::const_iterator j);
#define MAX_MATCHES 30
extern string_type expression;
extern string_type search_text;
extern string_type format_string;
extern string_type merge_string;
extern int matches[MAX_MATCHES];
#ifndef MAX_PATH
#define MAX_PATH 260
#endif
extern char file[MAX_PATH];
extern int line;
extern bool do_test;
extern unsigned int flags[5];
extern unsigned error_count;
struct flag_info
{
const char_t* name; // printable flag name
unsigned int len; // length of name
unsigned int value; // value of the flag
unsigned int id; // index to assign value to
};
extern flag_info flag_data[];
//
// class jm_debug_alloc
// NB this is a byte based allocator
//
class jm_debug_alloc
{
private:
int* blocks, *count;
jm_debug_alloc* guard;
public:
typedef std::size_t size_type;
typedef std::ptrdiff_t difference_type;
typedef char* pointer;
typedef const char* const_pointer;
typedef char& reference;
typedef const char& const_reference;
typedef char value_type;
#ifndef BOOST_RE_NO_MEMBER_TEMPLATES
template <class U>
struct rebind
{
typedef boost::re_detail::re_alloc_binder<U, jm_debug_alloc> other;
};
#endif
jm_debug_alloc();
jm_debug_alloc(const jm_debug_alloc& d);
jm_debug_alloc& operator=(const jm_debug_alloc& d);
~jm_debug_alloc();
void free_();
static pointer address(reference x)
{
return &x;
}
static const_pointer address(const_reference x)
{
return &x;
}
unsigned maxi(unsigned i, unsigned j)
{
return i < j ? j : i;
}
pointer allocate(size_type n, void* hint = 0);
void deallocate(pointer p, size_type n);
static size_type max_size()
{
return UINT_MAX;
}
static void construct(pointer , const char& )
{
}
static void destroy(pointer )
{
}
};
#ifdef __BORLANDC__
#if __BORLANDC__ < 0x520
#define BOOST_RE_BORLAND_FIX
#endif
#endif
//
// class debug_iterator
//
template <class T>
struct debug_iterator : public BOOST_RE_RA_ITERATOR(T, std::ptrdiff_t)
{
typedef std::ptrdiff_t difference_type;
typedef char_t value_type;
typedef char_t* pointer;
typedef char_t& reference;
typedef std::random_access_iterator_tag iterator_category;
typedef debug_iterator self;
typedef std::size_t size_type;
T cur;
T first;
T last;
debug_iterator(T c, T f, T l)
: cur(c), first(f), last(l) {}
debug_iterator() : cur(), first(), last() {}
debug_iterator(const debug_iterator& x)
: cur(x.cur), first(x.first), last(x.last) {}
debug_iterator& operator=(const debug_iterator& x)
{
cur = x.cur;
first = x.first;
last = x.last;
return *this;
}
reference operator*() const
{
if(cur == last)
{
begin_error();
cout << "Error: attempt to dereference iterator past range" << endl;
}
return *cur;
}
operator T()const { return cur; }
difference_type operator-(const self& x) const {
return (difference_type)(cur - x.cur);
}
self& operator++()
{
if(cur == last)
{
begin_error();
cout << "Error: attempt to increment iterator past range" << endl;
return *this;
}
++cur;
return *this;
}
self operator++(int)
{
self tmp = *this;
++*this;
return tmp;
}
self& operator--()
{
if(cur == first)
{
begin_error();
cout << "Error: attempt to decrement iterator past range" << endl;
return *this;
}
--cur;
return *this;
}
self operator--(int)
{
self tmp = *this;
--*this;
return tmp;
}
self& operator+=(difference_type n)
{
if((last - cur) < n)
{
begin_error();
cout << "Error: attempt to increment iterator past range" << endl;
return *this;
}
cur += n;
return *this;
}
self operator+(difference_type n) const
{
self tmp = *this;
return tmp += n;
}
self& operator-=(difference_type n) { return *this += -n; }
self operator-(difference_type n) const
{
self tmp = *this;
return tmp -= n;
}
reference operator[](difference_type n) const { return *(cur + n); }
bool operator==(const self& x) const { return cur == x.cur; }
bool operator!=(const self& x) const { return !(*this == x); }
bool operator<(const self& x) const {
return (cur < x.cur);
}
friend self operator+(difference_type n, const self& i)
{
self tmp = i;
return tmp += n;
}
};
#if defined(__SGI_STL_PORT) && (__SGI_STL_PORT >= 0x400)
namespace std{
template <class T>
inline random_access_iterator_tag __STL_CALL
__iterator_category(const debug_iterator<T>&) {
return random_access_iterator_tag();
}
}
#endif
#ifdef BOOST_RE_TEST_LOCALE_W32
typedef boost::reg_expression<char_t, boost::w32_regex_traits<char_t>, jm_debug_alloc> re_type;
#elif defined(BOOST_RE_TEST_LOCALE_CPP)
typedef boost::reg_expression<char_t, boost::cpp_regex_traits<char_t>, jm_debug_alloc> re_type;
#else
typedef boost::reg_expression<char_t, boost::c_regex_traits<char_t>, jm_debug_alloc> re_type;
#endif
#define REG_NO_POSIX_TEST 1
#define REG_UNICODE_ONLY 2
#define REG_GREP 4
#define REG_MERGE 8
#define REG_MERGE_COPY 16
#endif

View File

@ -1,29 +0,0 @@
# Makefile for timer application
#
# for SUN workshop 5.0 C++ compiler
#
CXX=CC
CPP_FLAGS = -O -I../../../../ -I./
all: r2 r5
r2 tests.txt
r5 tests.txt
%.o : %.cpp
$(CXX) -c -o $@ $(CPP_FLAGS) $<
r2 : tests.cpp parse.cpp regress.cpp
$(CXX) -o $@ $(CPP_FLAGS) tests.cpp parse.cpp regress.cpp -L../../lib -lregex++
r5 : tests.cpp parse.cpp regress.cpp
$(CXX) -o $@ $(CPP_FLAGS) -DTEST_UNICODE tests.cpp parse.cpp regress.cpp -L../../lib -lregex++
clean:
rm -rf SunWS_cache
rm -f r2.o r2 r5 r5.o

View File

@ -1,34 +0,0 @@
;
; This file tests code page 1252 - US / Western European code page.
;
; See tests.txt for a desciption of the scipt format.
;
- match_default extended REG_EXTENDED
; start by testing character classes:
[[:lower:]]+ <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> 1 32
[[:upper:]]+ <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> 1 31
[[:punct:]]+ <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> 0 31
[[:print:]]+ <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> 0 94
[[:graph:]]+ <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> 0 94
[a-z]+ <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> 0 31
[a-z]+ <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> 1 31
[[:word:]]+ <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> 0 61
;and equivalence classes:
[[=a=]]+ aA<61><41><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> 0 14
; and then test case mapping:
- match_default extended REG_EXTENDED REG_ICASE
;[A-Z]+ <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> 0 31
;[a-z]+ <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> 1 31
<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> 1 30

View File

@ -1,750 +0,0 @@
/*
*
* Copyright (c) 1998-2000
* Dr John Maddock
*
* Permission to use, copy, modify, distribute and sell this software
* and its documentation for any purpose is hereby granted without fee,
* provided that the above copyright notice appear in all copies and
* that both that copyright notice and this permission notice appear
* in supporting documentation. Dr John Maddock makes no representations
* about the suitability of this software for any purpose.
* It is provided "as is" without express or implied warranty.
*
*/
/*
*
* FILE tests.cpp
* VERSION 3.03
*
* the actual tests conducted by regress.
*
*/
#include <boost/regex.hpp>
#include "regress.h"
using namespace boost;
template <class M1, class M2>
bool compare_result(const M1& sm, const M2& m)
{
if(sm.size() != m.size())
return false;
if(sm.line() != m.line())
return false;
for(unsigned int i = 0; i < sm.size(); ++i)
{
if(sm.position(i) != m.position(i))
return false;
if(sm.length(i) != m.length(i))
return false;
}
return true;
}
template <class M1>
bool compare_result(const M1& sm, const M1& m)
{
return sm == m;
}
template <class C, class T, class A>
void cpp_eh_tests(const reg_expression<C, T, A>& )
{
#ifndef __GNUC__
bool thrown = false;
// try set_expression form first:
try
{
A a;
reg_expression<C, T, A> e(a);
e.set_expression(expression.c_str(), flags[2] | regbase::use_except);
}
catch(const boost::bad_expression&)
{
thrown = true;
}
catch(...){}
if(!thrown)
{
begin_error();
cout << "Error: expected exception not thrown" << endl;
}
// now try constructor form:
thrown = false;
try
{
A a;
reg_expression<C, T, A> e(expression.c_str(), flags[2] | regbase::use_except, a);
}
catch(const boost::bad_expression&)
{
thrown = true;
}
catch(...){}
if(!thrown)
{
begin_error();
cout << "Error: expected exception not thrown" << endl;
}
#endif
}
template <class iterator>
iterator find_last_line(iterator start, iterator end)
{
iterator result = start;
while(start != end)
{
if(*start == '\n')
{
++start;
result = start;
}
else
++start;
}
return result;
}
template <class iterator>
unsigned int count_lines(iterator start, iterator end)
{
unsigned int result = 0;
while(start != end)
{
if(*start == '\n')
++result;
++start;
}
return result;
}
template <class iterator, class Alloc>
class grep_test_predicate
{
int match_id;
iterator base, term;
public:
grep_test_predicate(iterator i, iterator j) : base(i), term(j) { match_id = 0; }
~grep_test_predicate(){}
bool operator()(const boost::match_results< iterator, Alloc >& m);
};
template <class iterator, class Alloc>
bool grep_test_predicate<iterator, Alloc>::operator()(const boost::match_results< iterator, Alloc >& m)
{
int start, end;
start = m[0].first - base;
end = m[0].second - base;
if((matches[match_id] != start) || (matches[match_id + 1] != end))
{
begin_error();
cout << "regex++ grep match error: found [" << start << "," << end << "] expected [" << matches[match_id] << "," << matches[match_id+1] << "]" << endl;
}
//
// check $`:
start = m[-1].first - base;
end = m[-1].second - base;
if(match_id &&
( (end != matches[match_id]) || (start != matches[match_id - 1]) )
)
{
begin_error();
cout << "regex++ grep error in $`: found [" << start << "," << end << "] expected [" << matches[match_id-1] << "," << matches[match_id] << "]" << endl;
}
else if((!match_id) && ((start != 0) || (end != matches[0])))
{
begin_error();
cout << "regex++ grep error in $`: found [" << start << "," << end << "] expected [" << 0 << "," << matches[0] << "]" << endl;
}
//
// check $':
start = m[-2].first - base;
end = m[-2].second - base;
if((start != matches[match_id + 1]) || (end != (term-base)))
{
begin_error();
cout << "regex++ grep error in $': found [" << start << "," << end << "] expected [" << matches[match_id + 1] << "," << (term-base) << "]" << endl;
}
//
// now check line()
start = m.line();
end = count_lines(base, iterator(m[0].first)) + 1;
if(start != end)
{
begin_error();
cout << "regex++ grep error in line(): found " << start << " expected " << end << endl;
}
//
// now check line_start()
start = m.line_start() - base;
end = find_last_line(base, iterator(m[0].first)) - base;
if(start != end)
{
begin_error();
cout << "regex++ grep error in line_start(): found " << start << " expected " << end << endl;
}
match_id += 2;
return true;
}
template <class C, class T, class A>
void cpp_tests(const reg_expression<C, T, A>& e, bool recurse = true)
{
typedef typename reg_expression<C, T, A>::allocator_type allocator_type;
if(flags[4] & REG_MERGE)
{
//
// test merge code:
//
string_type s;
s = regex_merge(search_text, e, format_string.c_str(), flags[3]);
if(s != merge_string)
{
begin_error();
cout << "merge result mismatch: found \"" << s.c_str() << "\" expected \"" << merge_string.c_str() << "\"" << endl;
}
return;
}
if(recurse)
{
// copy and assign test:
reg_expression<C, T, A> e2(e);
cpp_tests(e2, false);
e2 = e;
cpp_tests(e2, false);
}
if(e.error_code())
{
// verify that we don't expect expression to compile
if(search_text != BOOST_RE_STR("!"))
{
begin_error();
cout << "Expression did not compile using regex++ API" << endl;
}
else if((recurse) && ((flags[3] & match_partial) == 0))
cpp_eh_tests(e);
}
else if(flags[4] & REG_GREP)
{
// try to do grep:
debug_iterator<string_type::iterator> x(search_text.begin(), search_text.begin(), search_text.end());
debug_iterator<string_type::iterator> y(search_text.end(), search_text.begin(), search_text.end());
grep_test_predicate<debug_iterator<string_type::iterator>, allocator_type> oi(x, y);
regex_grep(oi, x, y, e, flags[3]);
#if !defined(BOOST_RE_NO_PARTIAL_FUNC_SPEC) && !defined(BOOST_RE_NO_STRING_H) && !defined(BOOST_RE_NO_STRING_DEF_ARGS)
if(!recurse)
{
std::basic_string<char_t> s(search_text.begin(), search_text.end());
grep_test_predicate<std::basic_string<char_t>::const_iterator, allocator_type> oi2(s.begin(), s.end());
regex_grep(oi2, s, e, flags[3]);
grep_test_predicate<const char_t*, allocator_type> oi3(s.c_str(), s.c_str()+s.size());
regex_grep(oi3, s.c_str(), e, flags[3]);
}
#endif
}
else
{
// try to find match
match_results< debug_iterator<string_type::iterator>, allocator_type> m;
debug_iterator<string_type::iterator> x(search_text.begin(), search_text.begin(), search_text.end());
debug_iterator<string_type::iterator> y(search_text.end(), search_text.begin(), search_text.end());
if(regex_search(x, y, m, e, flags[3]))
{
// match found compare what matched with what we expect:
int j = 0;
for(unsigned int i = 0; i < m.size(); ++i, j += 2)
{
if(m[i].matched == false)
{
if(matches[j] != -1)
{
begin_error();
cout << "regex++ API result mismatch in sub-expression " << i <<
", found (" << (m[i].first - x) << "," <<
(m[i].second - x) << ") expected (" <<
matches[j] << "," << matches[j+1] << ")" << endl;
}
}
else if(((m[i].first - x) != matches[j]) || ((m[i].second - x) != matches[j+1]))
{
begin_error();
cout << "regex++ API result mismatch in sub-expression " << i <<
", found (" << (m[i].first - x) << "," <<
(m[i].second - x) << ") expected (" <<
matches[j] << "," << matches[j+1] << ")" << endl;
}
}
//
// now check $` and $':
//
if((m[-1].first != x) || (m[-1].second != m[0].first))
{
begin_error();
cout << "regex++ API result mismatch in $` (match -1), found (" <<
(m[-1].first - x) << "," << (m[-1].second - x) << ") expected (0" <<
"," << matches[0] << ")" << endl;
}
if(((flags[3] & match_partial) == 0) && ((m[-2].first != m[0].second) || (m[-2].second != y)))
{
begin_error();
cout << "regex++ API result mismatch in $' (match -2), found (" <<
(m[-2].first - x) << "," << (m[-2].second - x) << ") expected (" <<
matches[1] << "," << (y-x) << ")" << endl;
}
//
// now try alternative forms of regex_search if available:
#if !defined(BOOST_RE_NO_PARTIAL_FUNC_SPEC) && !defined(BOOST_RE_NO_STRING_H) && !defined(BOOST_RE_NO_STRING_DEF_ARGS)
if(!recurse)
{
std::basic_string<char_t> s(search_text.begin(), search_text.end());
match_results<std::basic_string<char_t>::const_iterator> sm;
if(regex_search(s, sm, e, flags[3]))
{
if(compare_result(sm, m) == false)
{
begin_error();
cout << "regex++ API result mismatch in regex_search(const std::string&, match_results&, const reg_expression&, int)" << endl;
}
}
else
{
begin_error();
cout << "regex++ API result mismatch in regex_search(const std::string&, match_results&, const reg_expression&, int)" << endl;
}
//
// partial match should give same result as full match
// provided a full match is expected:
//
if(matches[0] > 0)
{
if(regex_search(x, y, m, e, flags[3] | boost::match_partial))
{
if(compare_result(sm, m) == false)
{
begin_error();
cout << "regex++ API result mismatch in regex_search when enabling match_partial" << endl;
}
}
else
{
begin_error();
cout << "regex++ API result: match not found when match_partial specified" << endl;
}
}
if(s.find(char_t(0)) == std::basic_string<char_t>::npos)
{
match_results<const char_t*> ssm;
if(regex_search(search_text.c_str(), ssm, e, flags[3]))
{
if(compare_result(ssm, m) == false)
{
begin_error();
cout << "regex++ API result mismatch in regex_search(const char_t*, match_results&, const reg_expression&, int)" << endl;
}
}
else
{
begin_error();
cout << "regex++ API result mismatch in regex_search(const char_t*, match_results&, const reg_expression&, int)" << endl;
}
}
}
if((false == recurse) && (matches[0] == 0) && (matches[1] == search_text.size()))
{
//
// match expected on whole string, so all versions
// of regex_match should also succeed:
//
match_results< debug_iterator<string_type::iterator>, allocator_type> m1;
debug_iterator<string_type::iterator> x1(search_text.begin(), search_text.begin(), search_text.end());
debug_iterator<string_type::iterator> y1(search_text.end(), search_text.begin(), search_text.end());
if(regex_match(x1, y1, m1, e, flags[3]))
{
if(compare_result(m1, m) == false)
{
begin_error();
cout << "regex++ API result mismatch in regex_match(iterator, iterator, match_results&, const reg_expression&, int)" << endl;
}
}
else
{
begin_error();
cout << "regex++ API result mismatch in regex_match(iterator, iterator, match_results&, const reg_expression&, int)" << endl;
}
std::basic_string<char_t> s(search_text.begin(), search_text.end());
match_results<std::basic_string<char_t>::const_iterator> sm;
if(regex_match(s, sm, e, flags[3]))
{
if(compare_result(sm, m) == false)
{
begin_error();
cout << "regex++ API result mismatch in regex_match(const std::string&, match_results&, const reg_expression&, int)" << endl;
}
}
else
{
begin_error();
cout << "regex++ API result mismatch in regex_match(const std::string&, match_results&, const reg_expression&, int)" << endl;
}
if(s.find(char_t(0)) == std::basic_string<char_t>::npos)
{
match_results<const char_t*> ssm;
if(regex_match(search_text.c_str(), ssm, e, flags[3]))
{
if(compare_result(ssm, m) == false)
{
begin_error();
cout << "regex++ API result mismatch in regex_match(const char_t*, match_results&, const reg_expression&, int)" << endl;
}
}
else
{
begin_error();
cout << "regex++ API result mismatch in regex_match(const char_t*, match_results&, const reg_expression&, int)" << endl;
}
}
}
#endif
}
else
{
// match not found
if(matches[0] != -1)
{
begin_error();
cout << "Match expected but not found using regex++ API" << endl;
}
}
}
}
#if !defined(TEST_UNICODE)
unsigned int hl_match_id;
bool hl_grep_test_proc(const RegEx& e)
{
int start, end;
start = e.Position(0);
end = start + e.Length();
if((matches[hl_match_id] != start) || (matches[hl_match_id + 1] != end))
{
begin_error();
cout << "class RegEx grep match error: found [" << start << "," << end << "] expected [" << matches[hl_match_id] << "," << matches[hl_match_id+1] << "]" << endl;
}
//
// check $`:
start = e.Position(-1);
end = start + e.Length(-1);
if(start == -1)
{
if(hl_match_id &&
( matches[hl_match_id] != matches[hl_match_id - 1] )
)
{
begin_error();
cout << "class RegEx grep error in $`: found [" << start << "," << end << "] expected [" << matches[hl_match_id-1] << "," << matches[hl_match_id] << "]" << endl;
}
else if((!hl_match_id) && (0 != matches[0]))
{
begin_error();
cout << "class RegEx grep error in $`: found [" << start << "," << end << "] expected [" << 0 << "," << matches[0] << "]" << endl;
}
}
else
{
if(hl_match_id &&
( (end != matches[hl_match_id]) || (start != matches[hl_match_id - 1]) )
)
{
begin_error();
cout << "class RegEx grep error in $`: found [" << start << "," << end << "] expected [" << matches[hl_match_id-1] << "," << matches[hl_match_id] << "]" << endl;
}
else if((!hl_match_id) && ((start != 0) || (end != matches[0])))
{
begin_error();
cout << "class RegEx grep error in $`: found [" << start << "," << end << "] expected [" << 0 << "," << matches[0] << "]" << endl;
}
}
//
// check $':
start = e.Position(-2);
end = start + e.Length(-2);
if(start == -1)
{
if(matches[hl_match_id + 1] != (int)search_text.size())
{
begin_error();
cout << "class RegEx grep error in $': found [" << start << "," << end << "] expected [" << matches[hl_match_id + 1] << "," << (search_text.size()) << "]" << endl;
}
}
else if((start != matches[hl_match_id + 1]) || (end != (int)search_text.size()))
{
begin_error();
cout << "class RegEx grep error in $': found [" << start << "," << end << "] expected [" << matches[hl_match_id + 1] << "," << (search_text.size()) << "]" << endl;
}
hl_match_id += 2;
return true;
}
void cpp_hl_tests(RegEx& e, bool recurse = true)
{
if(flags[4] & REG_MERGE)
return;
if(recurse)
{
// copy and assign test:
RegEx e2(e);
cpp_hl_tests(e2, false);
e2 = e;
cpp_hl_tests(e2, false);
}
if(flags[4] & REG_GREP)
{
// try to do grep:
hl_match_id = 0;
GrepCallback cb = hl_grep_test_proc;
e.Grep(cb, search_text.c_str(), flags[3]);
}
else
{
if(e.Search(search_text.c_str(), flags[3]))
{
unsigned int i = 0;
unsigned int j = 0;
while(matches[j] != -2)
{
if( (matches[j] != (int)e.Position(i)) || (matches[j+1] - matches[j] != (int)e.Length(i)) )
{
begin_error();
cout << "RegEx::Search error in subexpression " << i << ": found [" << e.Position(i) << "," << (e.Position(i) + e.Length(i)) << "] expected [" << matches[j] << "," << matches[j+1] << "]" << endl;
}
++i;
j += 2;
}
}
else
{
if(matches[0] != -1)
{
begin_error();
cout << "match expected but not found with RexEx::Search" << endl;
}
}
if((matches[0] == 0) && (e.Match(search_text.c_str(), flags[3])))
{
unsigned int i = 0;
unsigned int j = 0;
while(matches[j] != -2)
{
if( (matches[j] != (int)e.Position(i)) || (matches[j+1] - matches[j] != (int)e.Length(i)) )
{
begin_error();
cout << "RegEx::Match error in subexpression " << i << ": found [" << e.Position(i) << "," << (e.Position(i) + e.Length(i)) << "] expected [" << matches[j] << "," << matches[j+1] << "]" << endl;
}
++i;
j += 2;
}
}
}
}
#endif
template <class iterator>
bool has_nulls(iterator i, iterator j)
{
while(i != j)
{
if(*i == 0)
return true;
++i;
}
return false;
}
#ifdef TEST_UNICODE
#undef regcomp
#undef regerror
#undef regexec
#undef regfree
#undef regex_t
#define regcomp regcompW
#define regerror regerrorW
#define regexec regexecW
#define regfree regfreeW
#define regex_t regex_tW
#endif
void run_tests()
{
#ifndef TEST_UNICODE
if(flags[4] & REG_UNICODE_ONLY)
return;
#endif
#ifndef NO_CPP_TEST
try
{
unsigned int f = flags[2] & ~regbase::use_except;
if(flags[0] & REG_ICASE)
f |= regbase::icase;
re_type e(expression.c_str(), f);
cpp_tests(e, true);
}
#ifndef BOOST_RE_NO_EXCEPTION_H
catch(const std::exception& e)
{
//
// this is only an error if the expression is expected to be valid:
if(search_text != BOOST_RE_STR("!"))
{
begin_error();
cout << "Unexpected exception thrown from C++ library: " << e.what() << endl;
}
}
#endif
catch(...)
{
begin_error();
cout << "Unexpected exception thrown from C++ library" << endl;
}
#endif
#if !defined(TEST_UNICODE)
try
{
if(((flags[3] & match_partial) == 0) && (flags[2] == regbase::normal) && (has_nulls(search_text.begin(), search_text.end()) == false))
{
RegEx e;
e.SetExpression(expression.c_str(), flags[0] & REG_ICASE);
cpp_hl_tests(e, true);
}
}
catch(const std::exception& )
{
if(search_text != BOOST_RE_STR("!"))
{
begin_error();
cout << "Expression did not compile with class RegEx" << endl;
}
}
catch(...)
{
begin_error();
cout << "Unexpected exception thrown from RegEx::SetExpression" << endl;
}
#endif
if(flags[4] & (REG_NO_POSIX_TEST | REG_GREP | REG_MERGE | REG_MERGE_COPY))
return;
regex_t posix_expression;
regmatch_t m[MAX_MATCHES];
if(regcomp(&posix_expression, expression.c_str(), flags[0]) == 0)
{
if(flags[1] & REG_STARTEND)
{
m[0].rm_so = 0;
m[0].rm_eo = search_text.size();
}
if(regexec(&posix_expression, search_text.c_str(), MAX_MATCHES, m, flags[1]))
{
// match not found
if(matches[0] != -1)
{
begin_error();
cout << "Match expected but not found using POSIX API" << endl;
}
}
else
{
// match found compare what matched with what we expect:
int j = 0;
for(unsigned int i = 0; i <= posix_expression.re_nsub; ++i, j += 2)
{
if((m[i].rm_so != matches[j]) || (m[i].rm_eo != matches[j+1]))
{
begin_error();
cout << "POSIX API result mismatch in sub-expression " << i << ", found (" << m[i].rm_so << "," << m[i].rm_eo <<
") expected (" << matches[j] << "," << matches[j+1] << ")" << endl;
}
}
}
regfree(&posix_expression);
}
else
{
// expression did not compile
if(search_text != BOOST_RE_STR("!"))
{
begin_error();
cout << "Expression did not compile using POSIX API" << endl;
}
}
}
//
// error reporting:
int last_line = 0;
void begin_error()
{
if(line != last_line)
{
cout << "Error in line " << line << " of file " << file << endl;
cout << "Expression: " << expression.c_str() << endl;
cout << "Search text: " << search_text.c_str() << endl;
cout << "Flags: ";
bool started = false;
unsigned int id = 0;
while(flag_data[id].len != 0)
{
if(flags[flag_data[id].id] & flag_data[id].value)
{
if(started)
cout << " | ";
cout << flag_data[id].name;
started = true;
}
++id;
}
cout << endl;
last_line = line;
++error_count;
}
}
void reset_error()
{
last_line = 0;
}

View File

@ -1,870 +0,0 @@
;
;
; this file contains a script of tests to run through regress.exe
;
; comments start with a semicolon and proceed to the end of the line
;
; changes to regular expression compile flags start with a "-" as the first
; non-whitespace character and consist of a list of the printable names
; of the flags, for example "match_default"
;
; Other lines contain a test to perform using the current flag status
; the first token contains the expression to compile, the second the string
; to match it against. If the second string is "!" then the expression should
; not compile, that is the first string is an invalid regular expression.
; This is then followed by a list of integers that specify what should match,
; each pair represents the starting and ending positions of a subexpression
; starting with the zeroth subexpression (the whole match).
; A value of -1 indicates that the subexpression should not take part in the
; match at all, if the first value is -1 then no part of the expression should
; match the string.
;
- match_default normal REG_EXTENDED
;
; try some really simple literals:
a a 0 1
Z Z 0 1
Z aaa -1 -1
Z xxxxZZxxx 4 5
; and some simple brackets:
(a) zzzaazz 3 4 3 4
() zzz 0 0 0 0
() "" 0 0 0 0
( !
) !
(aa !
aa) !
a b -1 -1
\(\) () 0 2
\(a\) (a) 0 3
\() !
(\) !
p(a)rameter ABCparameterXYZ 3 12 4 5
[pq](a)rameter ABCparameterXYZ 3 12 4 5
; now try escaped brackets:
- match_default bk_parens REG_BASIC
\(a\) zzzaazz 3 4 3 4
\(\) zzz 0 0 0 0
\(\) "" 0 0 0 0
\( !
\) !
\(aa !
aa\) !
() () 0 2
(a) (a) 0 3
(\) !
\() !
; now move on to "." wildcards
- match_default normal REG_EXTENDED REG_STARTEND
. a 0 1
. \n 0 1
. \r 0 1
. \0 0 1
- match_default normal match_not_dot_newline REG_EXTENDED REG_STARTEND REG_NEWLINE
. a 0 1
. \n -1 -1
. \r -1 -1
. \0 0 1
- match_default normal match_not_dot_null match_not_dot_newline REG_EXTENDED REG_STARTEND REG_NEWLINE
. \n -1 -1
. \r -1 -1
; this *WILL* produce an error from the POSIX API functions:
- match_default normal match_not_dot_null match_not_dot_newline REG_EXTENDED REG_STARTEND REG_NEWLINE REG_NO_POSIX_TEST
. \0 -1 -1
;
; now move on to the repetion ops,
; starting with operator *
- match_default normal REG_EXTENDED
a* b 0 0
ab* a 0 1
ab* ab 0 2
ab* sssabbbbbbsss 3 10
ab*c* a 0 1
ab*c* abbb 0 4
ab*c* accc 0 4
ab*c* abbcc 0 5
*a !
\<* !
\>* !
\n* \n\n 0 2
\** ** 0 2
\* * 0 1
; now try operator +
ab+ a -1 -1
ab+ ab 0 2
ab+ sssabbbbbbsss 3 10
ab+c+ a -1 -1
ab+c+ abbb -1 -1
ab+c+ accc -1 -1
ab+c+ abbcc 0 5
+a !
\<+ !
\>+ !
\n+ \n\n 0 2
\+ + 0 1
\+ ++ 0 1
\++ ++ 0 2
- match_default normal bk_plus_qm REG_EXTENDED REG_NO_POSIX_TEST
+ + 0 1
\+ !
a\+ aa 0 2
; now try operator ?
- match_default normal REG_EXTENDED
a? b 0 0
ab? a 0 1
ab? ab 0 2
ab? sssabbbbbbsss 3 5
ab?c? a 0 1
ab?c? abbb 0 2
ab?c? accc 0 2
ab?c? abcc 0 3
?a !
\<? !
\>? !
\n? \n\n 0 1
\? ? 0 1
\? ?? 0 1
\?? ?? 0 1
- match_default normal bk_plus_qm REG_EXTENDED REG_NO_POSIX_TEST
? ? 0 1
\? !
a\? aa 0 1
a\? b 0 0
- match_default normal limited_ops
a? a? 0 2
a+ a+ 0 2
a\? a? 0 2
a\+ a+ 0 2
; now try operator {}
- match_default normal REG_EXTENDED
a{2} a -1 -1
a{2} aa 0 2
a{2} aaa 0 2
a{2,} a -1 -1
a{2,} aa 0 2
a{2,} aaaaa 0 5
a{2,4} a -1 -1
a{2,4} aa 0 2
a{2,4} aaa 0 3
a{2,4} aaaa 0 4
a{2,4} aaaaa 0 4
; spaces are now allowed inside {}
"a{ 2 , 4 }" aaaaa 0 4
a{} !
"a{ }" !
a{2 !
a} !
\{\} {} 0 2
- match_default normal bk_braces
a\{2\} a -1 -1
a\{2\} aa 0 2
a\{2\} aaa 0 2
a\{2,\} a -1 -1
a\{2,\} aa 0 2
a\{2,\} aaaaa 0 5
a\{2,4\} a -1 -1
a\{2,4\} aa 0 2
a\{2,4\} aaa 0 3
a\{2,4\} aaaa 0 4
a\{2,4\} aaaaa 0 4
"a\{ 2 , 4 \}" aaaaa 0 4
{} {} 0 2
; now test the alternation operator |
- match_default normal REG_EXTENDED
a|b a 0 1
a|b b 0 1
a(b|c) ab 0 2 1 2
a(b|c) ac 0 2 1 2
a(b|c) ad -1 -1 -1 -1
|c !
c| !
(|) !
(a|) !
(|a) !
a\| a| 0 2
- match_default normal limited_ops
a| a| 0 2
a\| a| 0 2
| | 0 1
- match_default normal bk_vbar REG_NO_POSIX_TEST
a| a| 0 2
a\|b a 0 1
a\|b b 0 1
; now test the set operator []
- match_default normal REG_EXTENDED
; try some literals first
[abc] a 0 1
[abc] b 0 1
[abc] c 0 1
[abc] d -1 -1
[^bcd] a 0 1
[^bcd] b -1 -1
[^bcd] d -1 -1
[^bcd] e 0 1
a[b]c abc 0 3
a[ab]c abc 0 3
a[^ab]c adc 0 3
a[]b]c a]c 0 3
a[[b]c a[c 0 3
a[-b]c a-c 0 3
a[^]b]c adc 0 3
a[^-b]c adc 0 3
a[b-]c a-c 0 3
a[b !
a[] !
; then some ranges
[b-e] a -1 -1
[b-e] b 0 1
[b-e] e 0 1
[b-e] f -1 -1
[^b-e] a 0 1
[^b-e] b -1 -1
[^b-e] e -1 -1
[^b-e] f 0 1
a[1-3]c a2c 0 3
a[3-1]c !
a[1-3-5]c !
a[1- !
; and some classes
a[[:alpha:]]c abc 0 3
a[[:unknown:]]c !
a[[: !
a[[:alpha !
a[[:alpha:] !
a[[:alpha,:] !
a[[:]:]]b !
a[[:-:]]b !
a[[:alph:]] !
a[[:alphabet:]] !
[[:alnum:]]+ -%@a0X- 3 6
[[:alpha:]]+ -%@aX0- 3 5
[[:blank:]]+ "a \tb" 1 4
[[:cntrl:]]+ a\n\tb 1 3
[[:digit:]]+ a019b 1 4
[[:graph:]]+ " a%b " 1 4
[[:lower:]]+ AabC 1 3
; This test fails with STLPort, disable for now as this is a corner case anyway...
;[[:print:]]+ "\na b\n" 1 4
[[:punct:]]+ " %-&\t" 1 4
[[:space:]]+ "a \n\t\rb" 1 5
[[:upper:]]+ aBCd 1 3
[[:xdigit:]]+ p0f3Cx 1 5
; now test flag settings:
- escape_in_lists REG_NO_POSIX_TEST
[\n] \n 0 1
- REG_NO_POSIX_TEST
[\n] \n -1 -1
[\n] \\ 0 1
[[:class:] : 0 1
[[:class:] [ 0 1
[[:class:] c 0 1
; line anchors
- match_default normal REG_EXTENDED
^ab ab 0 2
^ab xxabxx -1 -1
^ab xx\nabzz 3 5
ab$ ab 0 2
ab$ abxx -1 -1
ab$ ab\nzz 0 2
- match_default match_not_bol match_not_eol normal REG_EXTENDED REG_NOTBOL REG_NOTEOL
^ab ab -1 -1
^ab xxabxx -1 -1
^ab xx\nabzz 3 5
ab$ ab -1 -1
ab$ abxx -1 -1
ab$ ab\nzz 0 2
; back references
- match_default normal REG_EXTENDED
a(b)\2c !
a(b\1)c !
a(b*)c\1d abbcbbd 0 7 1 3
a(b*)c\1d abbcbd -1 -1
a(b*)c\1d abbcbbbd -1 -1
^(.)\1 abc -1 -1
a([bc])\1d abcdabbd 4 8 5 6
; strictly speaking this is at best ambiguous, at worst wrong, this is what most
; re implimentations will match though.
a(([bc])\2)*d abbccd 0 6 3 5 3 4
a(([bc])\2)*d abbcbd -1 -1
a((b)*\2)*d abbbd 0 5 1 4 2 3
(ab*)[ab]*\1 ababaaa 0 7 0 1
(a)\1bcd aabcd 0 5 0 1
(a)\1bc*d aabcd 0 5 0 1
(a)\1bc*d aabd 0 4 0 1
(a)\1bc*d aabcccd 0 7 0 1
(a)\1bc*[ce]d aabcccd 0 7 0 1
^(a)\1b(c)*cd$ aabcccd 0 7 0 1 4 5
;
; characters by code:
- match_default normal REG_EXTENDED REG_STARTEND
\0101 A 0 1
\00 \0 0 1
\0 \0 0 1
\0172 z 0 1
;
; word operators:
\w a 0 1
\w z 0 1
\w A 0 1
\w Z 0 1
\w _ 0 1
\w } -1 -1
\w ` -1 -1
\w [ -1 -1
\w @ -1 -1
; non-word:
\W a -1 -1
\W z -1 -1
\W A -1 -1
\W Z -1 -1
\W _ -1 -1
\W } 0 1
\W ` 0 1
\W [ 0 1
\W @ 0 1
; word start:
\<abcd " abcd" 2 6
\<ab cab -1 -1
\<ab "\nab" 1 3
\<tag ::tag 2 5
;word end:
abc\> abc 0 3
abc\> abcd -1 -1
abc\> abc\n 0 3
abc\> abc:: 0 3
; word boundary:
\babcd " abcd" 2 6
\bab cab -1 -1
\bab "\nab" 1 3
\btag ::tag 2 5
abc\b abc 0 3
abc\b abcd -1 -1
abc\b abc\n 0 3
abc\b abc:: 0 3
; within word:
\B ab 1 1
a\Bb ab 0 2
a\B ab 0 1
a\B a -1 -1
a\B "a " -1 -1
;
; buffer operators:
\`abc abc 0 3
\`abc \nabc -1 -1
\`abc " abc" -1 -1
abc\' abc 0 3
abc\' abc\n -1 -1
abc\' "abc " -1 -1
;
; extra escape sequences:
\a \a 0 1
\f \f 0 1
\n \n 0 1
\r \r 0 1
\t \t 0 1
\v \v 0 1
;
; now follows various complex expressions designed to try and bust the matcher:
a(((b)))c abc 0 3 1 2 1 2 1 2
a(b|(c))d abd 0 3 1 2 -1 -1
a(b|(c))d acd 0 3 1 2 1 2
a(b*|c)d abbd 0 4 1 3
; just gotta have one DFA-buster, of course
a[ab]{20} aaaaabaaaabaaaabaaaab 0 21
; and an inline expansion in case somebody gets tricky
a[ab][ab][ab][ab][ab][ab][ab][ab][ab][ab][ab][ab][ab][ab][ab][ab][ab][ab][ab][ab] aaaaabaaaabaaaabaaaab 0 21
; and in case somebody just slips in an NFA...
a[ab][ab][ab][ab][ab][ab][ab][ab][ab][ab][ab][ab][ab][ab][ab][ab][ab][ab][ab][ab](wee|week)(knights|night) aaaaabaaaabaaaabaaaabweeknights 0 31 21 24 24 31
; one really big one
1234567890123456789012345678901234567890123456789012345678901234567890 a1234567890123456789012345678901234567890123456789012345678901234567890b 1 71
; fish for problems as brackets go past 8
[ab][cd][ef][gh][ij][kl][mn] xacegikmoq 1 8
[ab][cd][ef][gh][ij][kl][mn][op] xacegikmoq 1 9
[ab][cd][ef][gh][ij][kl][mn][op][qr] xacegikmoqy 1 10
[ab][cd][ef][gh][ij][kl][mn][op][q] xacegikmoqy 1 10
; and as parenthesis go past 9:
(a)(b)(c)(d)(e)(f)(g)(h) zabcdefghi 1 9 1 2 2 3 3 4 4 5 5 6 6 7 7 8 8 9
(a)(b)(c)(d)(e)(f)(g)(h)(i) zabcdefghij 1 10 1 2 2 3 3 4 4 5 5 6 6 7 7 8 8 9 9 10
(a)(b)(c)(d)(e)(f)(g)(h)(i)(j) zabcdefghijk 1 11 1 2 2 3 3 4 4 5 5 6 6 7 7 8 8 9 9 10 10 11
(a)(b)(c)(d)(e)(f)(g)(h)(i)(j)(k) zabcdefghijkl 1 12 1 2 2 3 3 4 4 5 5 6 6 7 7 8 8 9 9 10 10 11 11 12
(a)d|(b)c abc 1 3 -1 -1 1 2
"_+((www)|(ftp)|(mailto)):_*" "_wwwnocolon _mailto:" 12 20 13 19 -1 -1 -1 -1 13 19
; subtleties of matching
a(b)?c\1d acd 0 3 -1 -1
a(b?c)+d accd 0 4 2 3
(wee|week)(knights|night) weeknights 0 10 0 3 3 10
.* abc 0 3
a(b|(c))d abd 0 3 1 2 -1 -1
a(b|(c))d acd 0 3 1 2 1 2
a(b*|c|e)d abbd 0 4 1 3
a(b*|c|e)d acd 0 3 1 2
a(b*|c|e)d ad 0 2 1 1
a(b?)c abc 0 3 1 2
a(b?)c ac 0 2 1 1
a(b+)c abc 0 3 1 2
a(b+)c abbbc 0 5 1 4
a(b*)c ac 0 2 1 1
(a|ab)(bc([de]+)f|cde) abcdef 0 6 0 1 1 6 3 5
a([bc]?)c abc 0 3 1 2
a([bc]?)c ac 0 2 1 1
a([bc]+)c abc 0 3 1 2
a([bc]+)c abcc 0 4 1 3
a([bc]+)bc abcbc 0 5 1 3
a(bb+|b)b abb 0 3 1 2
a(bbb+|bb+|b)b abb 0 3 1 2
a(bbb+|bb+|b)b abbb 0 4 1 3
a(bbb+|bb+|b)bb abbb 0 4 1 2
(.*).* abcdef 0 6 0 6
(a*)* bc 0 0 0 0
; do we get the right subexpression when it is used more than once?
a(b|c)*d ad 0 2 -1 -1
a(b|c)*d abcd 0 4 2 3
a(b|c)+d abd 0 3 1 2
a(b|c)+d abcd 0 4 2 3
a(b|c?)+d ad 0 2 1 1
a(b|c?)+d abcd 0 4 2 3
a(b|c){0,0}d ad 0 2 -1 -1
a(b|c){0,1}d ad 0 2 -1 -1
a(b|c){0,1}d abd 0 3 1 2
a(b|c){0,2}d ad 0 2 -1 -1
a(b|c){0,2}d abcd 0 4 2 3
a(b|c){0,}d ad 0 2 -1 -1
a(b|c){0,}d abcd 0 4 2 3
a(b|c){1,1}d abd 0 3 1 2
a(b|c){1,2}d abd 0 3 1 2
a(b|c){1,2}d abcd 0 4 2 3
a(b|c){1,}d abd 0 3 1 2
a(b|c){1,}d abcd 0 4 2 3
a(b|c){2,2}d acbd 0 4 2 3
a(b|c){2,2}d abcd 0 4 2 3
a(b|c){2,4}d abcd 0 4 2 3
a(b|c){2,4}d abcbd 0 5 3 4
a(b|c){2,4}d abcbcd 0 6 4 5
a(b|c){2,}d abcd 0 4 2 3
a(b|c){2,}d abcbd 0 5 3 4
a(b+|((c)*))+d abd 0 3 1 2 -1 -1 -1 -1
a(b+|((c)*))+d abcd 0 4 2 3 2 3 2 3
- match_default normal REG_EXTENDED REG_STARTEND REG_NOSPEC literal
\**?/{} \\**?/{} 0 7
- match_default normal REG_EXTENDED REG_NO_POSIX_TEST ; we disable POSIX testing because it can't handle escapes in sets
; try to match C++ syntax elements:
; line comment:
//[^\n]* "++i //here is a line comment\n" 4 28
; block comment:
/\*([^*]|\*+[^*/])*\*+/ "/* here is a block comment */" 0 29 26 27
/\*([^*]|\*+[^*/])*\*+/ "/**/" 0 4 -1 -1
/\*([^*]|\*+[^*/])*\*+/ "/***/" 0 5 -1 -1
/\*([^*]|\*+[^*/])*\*+/ "/****/" 0 6 -1 -1
/\*([^*]|\*+[^*/])*\*+/ "/*****/" 0 7 -1 -1
/\*([^*]|\*+[^*/])*\*+/ "/*****/*/" 0 7 -1 -1
; preprossor directives:
^[[:blank:]]*#([^\n]*\\[[:space:]]+)*[^\n]* "#define some_symbol" 0 19 -1 -1
^[[:blank:]]*#([^\n]*\\[[:space:]]+)*[^\n]* "#define some_symbol(x) #x" 0 25 -1 -1
^[[:blank:]]*#([^\n]*\\[[:space:]]+)*[^\n]* "#define some_symbol(x) \\ \r\n foo();\\\r\n printf(#x);" 0 53 28 42
; literals:
((0x[[:xdigit:]]+)|([[:digit:]]+))u?((int(8|16|32|64))|L)? 0xFF 0 4 0 4 0 4 -1 -1 -1 -1 -1 -1 -1 -1
((0x[[:xdigit:]]+)|([[:digit:]]+))u?((int(8|16|32|64))|L)? 35 0 2 0 2 -1 -1 0 2 -1 -1 -1 -1 -1 -1
((0x[[:xdigit:]]+)|([[:digit:]]+))u?((int(8|16|32|64))|L)? 0xFFu 0 5 0 4 0 4 -1 -1 -1 -1 -1 -1 -1 -1
((0x[[:xdigit:]]+)|([[:digit:]]+))u?((int(8|16|32|64))|L)? 0xFFL 0 5 0 4 0 4 -1 -1 4 5 -1 -1 -1 -1
((0x[[:xdigit:]]+)|([[:digit:]]+))u?((int(8|16|32|64))|L)? 0xFFFFFFFFFFFFFFFFuint64 0 24 0 18 0 18 -1 -1 19 24 19 24 22 24
; strings:
'([^\\']|\\.)*' '\\x3A' 0 6 4 5
'([^\\']|\\.)*' '\\'' 0 4 1 3
'([^\\']|\\.)*' '\\n' 0 4 1 3
; now try and test some unicode specific characters:
- match_default normal REG_EXTENDED REG_UNICODE_ONLY
[[:unicode:]]+ a\0300\0400z 1 3
; finally try some case insensitive matches:
- match_default normal REG_EXTENDED REG_ICASE
; upper and lower have no meaning here so they fail, however these
; may compile with other libraries...
;[[:lower:]] !
;[[:upper:]] !
0123456789@abcdefghijklmnopqrstuvwxyz\[\\\]\^_`ABCDEFGHIJKLMNOPQRSTUVWXYZ\{\|\} 0123456789@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\\]\^_`abcdefghijklmnopqrstuvwxyz\{\|\} 0 72
; known and suspected bugs:
- match_default normal REG_EXTENDED
\( ( 0 1
\) ) 0 1
\$ $ 0 1
\^ ^ 0 1
\. . 0 1
\* * 0 1
\+ + 0 1
\? ? 0 1
\[ [ 0 1
\] ] 0 1
\| | 0 1
\\ \\ 0 1
# # 0 1
\# # 0 1
a- a- 0 2
\- - 0 1
\{ { 0 1
\} } 0 1
0 0 0 1
1 1 0 1
9 9 0 1
b b 0 1
B B 0 1
< < 0 1
> > 0 1
w w 0 1
W W 0 1
` ` 0 1
' ' 0 1
\n \n 0 1
, , 0 1
a a 0 1
f f 0 1
n n 0 1
r r 0 1
t t 0 1
v v 0 1
c c 0 1
x x 0 1
: : 0 1
(\.[[:alnum:]]+){2} "w.a.b " 1 5 3 5
- match_default normal REG_EXTENDED REG_ICASE
a A 0 1
A a 0 1
[abc]+ abcABC 0 6
[ABC]+ abcABC 0 6
[a-z]+ abcABC 0 6
[A-Z]+ abzANZ 0 6
[a-Z]+ abzABZ 0 6
[A-z]+ abzABZ 0 6
[[:lower:]]+ abyzABYZ 0 8
[[:upper:]]+ abzABZ 0 6
[[:word:]]+ abcZZZ 0 6
[[:alpha:]]+ abyzABYZ 0 8
[[:alnum:]]+ 09abyzABYZ 0 10
; updated tests for version 2:
- match_default normal REG_EXTENDED
\x41 A 0 1
\xff \255 0 1
\xFF \255 0 1
- match_default normal REG_EXTENDED REG_NO_POSIX_TEST
\c@ \0 0 1
- match_default normal REG_EXTENDED
\cA \1 0 1
\cz \58 0 1
\c= !
\c? !
=: =: 0 2
; word start:
[[:<:]]abcd " abcd" 2 6
[[:<:]]ab cab -1 -1
[[:<:]]ab "\nab" 1 3
[[:<:]]tag ::tag 2 5
;word end:
abc[[:>:]] abc 0 3
abc[[:>:]] abcd -1 -1
abc[[:>:]] abc\n 0 3
abc[[:>:]] abc:: 0 3
; collating elements and rewritten set code:
- match_default normal REG_EXTENDED REG_STARTEND
[[.zero.]] 0 0 1
[[.one.]] 1 0 1
[[.two.]] 2 0 1
[[.three.]] 3 0 1
[[.a.]] baa 1 2
[[.right-curly-bracket.]] } 0 1
[[.NUL.]] \0 0 1
[[:<:]z] !
[a[:>:]] !
[[=a=]] a 0 1
[[=right-curly-bracket=]] } 0 1
- match_default normal REG_EXTENDED REG_STARTEND REG_ICASE
[[.A.]] A 0 1
[[.A.]] a 0 1
[[.A.]-b]+ AaBb 0 4
[A-[.b.]]+ AaBb 0 4
[[.a.]-B]+ AaBb 0 4
[a-[.B.]]+ AaBb 0 4
- match_default normal REG_EXTENDED REG_NO_POSIX_TEST
[\x61] a 0 1
[\x61-c]+ abcd 0 3
[a-\x63]+ abcd 0 3
- match_default normal REG_EXTENDED REG_STARTEND
[[.a.]-c]+ abcd 0 3
[a-[.c.]]+ abcd 0 3
[[:alpha:]-a] !
[a-[:alpha:]] !
; try mutli-character ligatures:
[[.ae.]] ae 0 2
[[.ae.]] aE -1 -1
[[.AE.]] AE 0 2
[[.Ae.]] Ae 0 2
[[.ae.]-b] a -1 -1
[[.ae.]-b] b 0 1
[[.ae.]-b] ae 0 2
[a-[.ae.]] a 0 1
[a-[.ae.]] b -1 -1
[a-[.ae.]] ae 0 2
- match_default normal REG_EXTENDED REG_STARTEND REG_ICASE
[[.ae.]] AE 0 2
[[.ae.]] Ae 0 2
[[.AE.]] Ae 0 2
[[.Ae.]] aE 0 2
[[.AE.]-B] a -1 -1
[[.Ae.]-b] b 0 1
[[.Ae.]-b] B 0 1
[[.ae.]-b] AE 0 2
- match_default normal REG_EXTENDED REG_STARTEND
;extended perl style escape sequences:
\e \27 0 1
\x1b \27 0 1
\x{1b} \27 0 1
\x{} !
\x{ !
\x} !
\x !
\x{yy !
\x{1b !
- match_default normal REG_EXTENDED REG_STARTEND REG_NO_POSIX_TEST
\l+ ABabcAB 2 5
[\l]+ ABabcAB 2 5
[a-\l] !
[\l-a] !
[\L] !
\L+ abABCab 2 5
\u+ abABCab 2 5
[\u]+ abABCab 2 5
[\U] !
\U+ ABabcAB 2 5
\d+ ab012ab 2 5
[\d]+ ab012ab 2 5
[\D] !
\D+ 01abc01 2 5
\s+ "ab ab" 2 5
[\s]+ "ab ab" 2 5
[\S] !
\S+ " abc " 2 5
- match_default normal REG_EXTENDED REG_STARTEND
\Qabc !
\Qabc\E abcd 0 3
\Qabc\Ed abcde 0 4
\Q+*?\\E +*?\\ 0 4
\C+ abcde 0 5
\X+ abcde 0 5
- match_default normal REG_EXTENDED REG_STARTEND REG_UNICODE_ONLY
\X+ a\768\769 0 3
\X+ \2309\2307 0 2 ;DEVANAGARI script
\X+ \2489\2494 0 2 ;BENGALI script
- match_default normal REG_EXTENDED REG_STARTEND
\Aabc abc 0 3
\Aabc aabc -1 -1
abc\z abc 0 3
abc\z abcd -1 -1
abc\Z abc\n\n 0 3
abc\Z abc 0 3
\Gabc abc 0 3
\Gabc dabcd -1 -1
a\Gbc abc -1 -1
a\Aab abc -1 -1
;
; now test grep,
; basically check all our restart types - line, word, etc
; checking each one for null and non-null matches.
;
- match_default normal REG_EXTENDED REG_STARTEND REG_GREP
a " a a a aa" 1 2 3 4 5 6 7 8 8 9
a+b+ "aabaabbb ab" 0 3 3 8 9 11
a(b*|c|e)d adabbdacd 0 2 2 6 6 9
a "\na\na\na\naa" 1 2 3 4 5 6 7 8 8 9
^ " \n\n \n\n\n" 0 0 4 4 5 5 8 8 9 9 10 10
^ab "ab \nab ab\n" 0 2 5 7
^[^\n]*\n " \n \n\n \n" 0 4 4 7 7 8 8 11
\<abc "abcabc abc\n\nabc" 0 3 7 10 12 15
\< " ab a aaa " 2 2 5 5 7 7
\<\w+\W+ " aa aa a " 1 5 5 9 9 11
\Aabc "abc abc" 0 3
\G\w+\W+ "abc abc a cbbb " 0 5 5 9 9 11 11 18
\Ga+b+ "aaababb abb" 0 4 4 7
abc abc 0 3
abc " abc abcabc " 1 4 5 8 8 11
\n\n " \n\n\n \n \n\n\n\n " 1 3 18 20 20 22
$ " \n\n \n\n\n" 3 3 4 4 7 7 8 8 9 9 10 10
\b " abb a abbb " 2 2 5 5 6 6 7 7 8 8 12 12
- match_default normal REG_EXTENDED REG_STARTEND REG_GREP REG_ICASE
A " a a a aa" 1 2 3 4 5 6 7 8 8 9
A+B+ "aabaabbb ab" 0 3 3 8 9 11
A(B*|c|e)D adabbdacd 0 2 2 6 6 9
A "\na\na\na\naa" 1 2 3 4 5 6 7 8 8 9
^aB "Ab \nab Ab\n" 0 2 5 7
\<abc "Abcabc aBc\n\nabc" 0 3 7 10 12 15
ABC abc 0 3
abc " ABC ABCABC " 1 4 5 8 8 11
;
; now test merge,
;
- match_default normal REG_EXTENDED REG_STARTEND REG_MERGE format_no_copy
; start by testing subs:
a+ "...aaa,,," $` "..."
a+ "...aaa,,," $' ",,,"
a+ "...aaa,,," $& "aaa"
a+ "...aaa,,," $0 aaa
a+ "...aaa,,," $1 ""
a+ "...aaa,,," $15 ""
(a+)b+ "...aaabbb,,," $1 aaa
; and now escapes:
a+ "...aaa,,," $x "$x"
a+ "...aaa,,," \a "\a"
a+ "...aaa,,," \f "\f"
a+ "...aaa,,," \n "\n"
a+ "...aaa,,," \r "\r"
a+ "...aaa,,," \t "\t"
a+ "...aaa,,," \v "\v"
a+ "...aaa,,," \x21 "!"
a+ "...aaa,,," \x{21} "!"
a+ "...aaa,,," \c@ \0
a+ "...aaa,,," \e \27
a+ "...aaa,,," \0101 A
a+ "...aaa,,," (\0101) A
- match_default normal REG_EXTENDED REG_STARTEND REG_MERGE format_sed format_no_copy
(a+)(b+) ...aabb,, \0 aabb
(a+)(b+) ...aabb,, \1 aa
(a+)(b+) ...aabb,, \2 bb
(a+)(b+) ...aabb,, & aabb
(a+)(b+) ...aabb,, $ $
(a+)(b+) ...aabb,, $1 $1
(a+)(b+) ...aabb,, ()?: ()?:
(a+)(b+) ...aabb,, \\ \\
(a+)(b+) ...aabb,, \& &
- match_default normal REG_EXTENDED REG_STARTEND REG_MERGE format_perl format_no_copy
(a+)(b+) ...aabb,, $0 aabb
(a+)(b+) ...aabb,, $1 aa
(a+)(b+) ...aabb,, $2 bb
(a+)(b+) ...aabb,, $& aabb
(a+)(b+) ...aabb,, & &
(a+)(b+) ...aabb,, \0 \0
(a+)(b+) ...aabb,, ()?: ()?:
- match_default normal REG_EXTENDED REG_STARTEND REG_MERGE
; move to copying unmatched data:
a+ "...aaa,,," bbb "...bbb,,,"
a+(b+) "...aaabb,,," $1 "...bb,,,"
a+(b+) "...aaabb,,,ab*abbb?" $1 "...bb,,,b*bbb?"
(a+)|(b+) "...aaabb,,,ab*abbb?" (?1A)(?2B) "...AB,,,AB*AB?"
(a+)|(b+) "...aaabb,,,ab*abbb?" ?1A:B "...AB,,,AB*AB?"
(a+)|(b+) "...aaabb,,,ab*abbb?" (?1A:B)C "...ACBC,,,ACBC*ACBC?"
(a+)|(b+) "...aaabb,,,ab*abbb?" ?1:B "...B,,,B*B?"
;
; changes to newline handling with 2.11:
;
- match_default normal REG_EXTENDED REG_STARTEND REG_GREP
^. " \n \r\n " 0 1 3 4 7 8
.$ " \n \r\n " 1 2 4 5 8 9
- match_default normal REG_EXTENDED REG_STARTEND REG_GREP REG_UNICODE_ONLY
^. " \8232 \8233 " 0 1 3 4 5 6
.$ " \8232 \8233 " 1 2 3 4 6 7
;
; non-greedy repeats added 21/04/00
- match_default normal REG_EXTENDED
a** !
a*? aa 0 0
a?? aa 0 0
a++ !
a+? aa 0 1
a{1,3}{1} !
a{1,3}? aaa 0 1
\w+?w ...ccccccwcccccw 3 10
\W+\w+?w ...ccccccwcccccw 0 10
abc|\w+? abd 0 1
abc|\w+? abcd 0 3
<\s*tag[^>]*>(.*?)<\s*/tag\s*> " <tag>here is some text</tag> <tag></tag>" 1 29 6 23
<\s*tag[^>]*>(.*?)<\s*/tag\s*> " < tag attr=\"something\">here is some text< /tag > <tag></tag>" 1 49 24 41
;
; non-marking parenthesis added 25/04/00
- match_default normal REG_EXTENDED
(?:abc)+ xxabcabcxx 2 8
(?:a+)(b+) xaaabbbx 1 7 4 7
(a+)(?:b+) xaaabbba 1 7 1 4
(?:(a+)b+) xaaabbba 1 7 1 4
(?:a+(b+)) xaaabbba 1 7 4 7
a+(?#b+)b+ xaaabbba 1 7
;
; try some partial matches:
- match_partial match_default normal REG_EXTENDED REG_NO_POSIX_TEST
(xyz)(.*)abc xyzaaab -1 -1 0 3 3 7
(xyz)(.*)abc xyz -1 -1 0 3 3 3
(xyz)(.*)abc xy -1 -1 -1 -1 -1 -1

View File

@ -1,166 +0,0 @@
# very basic makefile for regression tests
#
# Visual C++ 6 + full stlport 4.x
#
# we don't test single threaded builds as stlport doesn't support these...
#
CFLAGS= /Oityb1 /GF /Gy -GX -GR -I..\..\..\..\
LFLAGS= -link /LIBPATH:..\..\lib\vc6-stlport user32.lib
all :: r1m.exe r2m.exe r3m.exe r4m.exe r5m.exe r6m.exe r1l.exe r2l.exe r3l.exe r4l.exe r5l.exe r6l.exe r1md.exe r2md.exe r3md.exe r4md.exe r5md.exe r6md.exe r1lmd.exe r2lmd.exe r3lmd.exe r4lmd.exe r5lmd.exe r6lmd.exe r1mdd.exe r2mdd.exe r3mdd.exe r4mdd.exe r5mdd.exe r6mdd.exe r1lmdd.exe r2lmdd.exe r3lmdd.exe
echo testing static multi-threaded version....
r1m tests.txt test1252.txt
r2m tests.txt
r3m tests.txt
r4m tests.txt test1252.txt
r5m tests.txt
r6m tests.txt
echo testing DLL version....
r1l tests.txt test1252.txt
r2l tests.txt
r3l tests.txt
r4l tests.txt test1252.txt
r5l tests.txt
r6l tests.txt
echo testing static multi-threaded debug version....
r1md tests.txt test1252.txt
r2md tests.txt
r3md tests.txt
r4md tests.txt test1252.txt
r5md tests.txt
r6md tests.txt
echo testing dll debug version....
r1lmd tests.txt test1252.txt
r2lmd tests.txt
r3lmd tests.txt
r4lmd tests.txt test1252.txt
r5lmd tests.txt
r6lmd tests.txt
echo testing static multi-threaded stl-debug version....
r1mdd tests.txt test1252.txt
r2mdd tests.txt
r3mdd tests.txt
r4mdd tests.txt test1252.txt
r5mdd tests.txt
r6mdd tests.txt
echo testing dll stl-debug version....
r1lmdd tests.txt test1252.txt
r2lmdd tests.txt
r3lmdd tests.txt
r1m.exe : tests.cpp parse.cpp regress.cpp
cl /MT /D_MT -o r1m.exe $(CFLAGS) -DBOOST_RE_TEST_LOCALE_W32 tests.cpp parse.cpp regress.cpp $(LFLAGS)
r2m.exe : tests.cpp parse.cpp regress.cpp
cl /MT /D_MT $(CFLAGS) -o r2m.exe -DBOOST_RE_TEST_LOCALE_C tests.cpp parse.cpp regress.cpp $(LFLAGS)
r3m.exe : tests.cpp parse.cpp regress.cpp
cl /MT /D_MT $(CFLAGS) -o r3m.exe -DBOOST_RE_TEST_LOCALE_CPP tests.cpp parse.cpp regress.cpp $(LFLAGS)
r4m.exe : tests.cpp parse.cpp regress.cpp
cl /MT /D_MT $(CFLAGS) -o r4m.exe -DBOOST_RE_TEST_LOCALE_W32 -DTEST_UNICODE tests.cpp parse.cpp regress.cpp $(LFLAGS)
r5m.exe : tests.cpp parse.cpp regress.cpp
cl /MT /D_MT $(CFLAGS) -o r5m.exe -DBOOST_RE_TEST_LOCALE_C -DTEST_UNICODE tests.cpp parse.cpp regress.cpp $(LFLAGS)
r6m.exe : tests.cpp parse.cpp regress.cpp
cl /MT /D_MT $(CFLAGS) -o r6m.exe -DBOOST_RE_TEST_LOCALE_CPP -DTEST_UNICODE tests.cpp parse.cpp regress.cpp $(LFLAGS)
r1l.exe : tests.cpp parse.cpp regress.cpp
cl /MD /D_MT /D_DLL $(CFLAGS) -o r1l.exe -DBOOST_RE_TEST_LOCALE_W32 tests.cpp parse.cpp regress.cpp $(LFLAGS)
r2l.exe : tests.cpp parse.cpp regress.cpp
cl /MD /D_MT /D_DLL $(CFLAGS) -o r2l.exe -DBOOST_RE_TEST_LOCALE_C tests.cpp parse.cpp regress.cpp $(LFLAGS)
r3l.exe : tests.cpp parse.cpp regress.cpp
cl /MD /D_MT /D_DLL $(CFLAGS) -o r3l.exe -DBOOST_RE_TEST_LOCALE_CPP tests.cpp parse.cpp regress.cpp $(LFLAGS)
r4l.exe : tests.cpp parse.cpp regress.cpp
cl /MD /D_MT /D_DLL $(CFLAGS) -o r4l.exe -DBOOST_RE_TEST_LOCALE_W32 -DTEST_UNICODE tests.cpp parse.cpp regress.cpp $(LFLAGS)
r5l.exe : tests.cpp parse.cpp regress.cpp
cl /MD /D_MT /D_DLL $(CFLAGS) -o r5l.exe -DBOOST_RE_TEST_LOCALE_C -DTEST_UNICODE tests.cpp parse.cpp regress.cpp $(LFLAGS)
r6l.exe : tests.cpp parse.cpp regress.cpp
cl /MD /D_MT /D_DLL $(CFLAGS) -o r6l.exe -DBOOST_RE_TEST_LOCALE_CPP -DTEST_UNICODE tests.cpp parse.cpp regress.cpp $(LFLAGS)
r1md.exe : tests.cpp parse.cpp regress.cpp
cl /MTd /D_MT $(CFLAGS) -o r1md.exe -DBOOST_RE_TEST_LOCALE_W32 tests.cpp parse.cpp regress.cpp $(LFLAGS)
r2md.exe : tests.cpp parse.cpp regress.cpp
cl /MTd /D_MT $(CFLAGS) -o r2md.exe -DBOOST_RE_TEST_LOCALE_C tests.cpp parse.cpp regress.cpp $(LFLAGS)
r3md.exe : tests.cpp parse.cpp regress.cpp
cl /MTd /D_MT $(CFLAGS) -o r3md.exe -DBOOST_RE_TEST_LOCALE_CPP tests.cpp parse.cpp regress.cpp $(LFLAGS)
r4md.exe : tests.cpp parse.cpp regress.cpp
cl /MTd /D_MT $(CFLAGS) -o r4md.exe -DBOOST_RE_TEST_LOCALE_W32 -DTEST_UNICODE tests.cpp parse.cpp regress.cpp $(LFLAGS)
r5md.exe : tests.cpp parse.cpp regress.cpp
cl /MTd /D_MT $(CFLAGS) -o r5md.exe -DBOOST_RE_TEST_LOCALE_C -DTEST_UNICODE tests.cpp parse.cpp regress.cpp $(LFLAGS)
r6md.exe : tests.cpp parse.cpp regress.cpp
cl /MTd /D_MT $(CFLAGS) -o r6md.exe -DBOOST_RE_TEST_LOCALE_CPP -DTEST_UNICODE tests.cpp parse.cpp regress.cpp $(LFLAGS)
r1lmd.exe : tests.cpp parse.cpp regress.cpp
cl /MDd /D_MT /D_DLL $(CFLAGS) -o r1lmd.exe -DBOOST_RE_TEST_LOCALE_W32 tests.cpp parse.cpp regress.cpp $(LFLAGS)
r2lmd.exe : tests.cpp parse.cpp regress.cpp
cl /MDd /D_MT /D_DLL $(CFLAGS) -o r2lmd.exe -DBOOST_RE_TEST_LOCALE_C tests.cpp parse.cpp regress.cpp $(LFLAGS)
r3lmd.exe : tests.cpp parse.cpp regress.cpp
cl /MDd /D_MT /D_DLL $(CFLAGS) -o r3lmd.exe -DBOOST_RE_TEST_LOCALE_CPP tests.cpp parse.cpp regress.cpp $(LFLAGS)
r4lmd.exe : tests.cpp parse.cpp regress.cpp
cl /MDd /D_MT /D_DLL $(CFLAGS) -o r4lmd.exe -DBOOST_RE_TEST_LOCALE_W32 -DTEST_UNICODE tests.cpp parse.cpp regress.cpp $(LFLAGS)
r5lmd.exe : tests.cpp parse.cpp regress.cpp
cl /MDd /D_MT /D_DLL $(CFLAGS) -o r5lmd.exe -DBOOST_RE_TEST_LOCALE_C -DTEST_UNICODE tests.cpp parse.cpp regress.cpp $(LFLAGS)
r6lmd.exe : tests.cpp parse.cpp regress.cpp
cl /MDd /D_MT /D_DLL $(CFLAGS) -o r6lmd.exe -DBOOST_RE_TEST_LOCALE_CPP -DTEST_UNICODE tests.cpp parse.cpp regress.cpp $(LFLAGS)
r1lmdd.exe : tests.cpp parse.cpp regress.cpp
cl /MDd /D_MT /D_DLL $(CFLAGS) -o r1lmdd.exe -D__STL_DEBUG -DBOOST_RE_TEST_LOCALE_W32 tests.cpp parse.cpp regress.cpp $(LFLAGS)
r2lmdd.exe : tests.cpp parse.cpp regress.cpp
cl /MDd /D_MT /D_DLL $(CFLAGS) -o r2lmdd.exe -D__STL_DEBUG -DBOOST_RE_TEST_LOCALE_C tests.cpp parse.cpp regress.cpp $(LFLAGS)
r3lmdd.exe : tests.cpp parse.cpp regress.cpp
cl /MDd /D_MT /D_DLL $(CFLAGS) -o r3lmdd.exe -D__STL_DEBUG -DBOOST_RE_TEST_LOCALE_CPP tests.cpp parse.cpp regress.cpp $(LFLAGS)
r4lmdd.exe : tests.cpp parse.cpp regress.cpp
cl /MDd /D_MT /D_DLL $(CFLAGS) -o r4lmdd.exe -D__STL_DEBUG -DBOOST_RE_TEST_LOCALE_W32 -DTEST_UNICODE tests.cpp parse.cpp regress.cpp $(LFLAGS)
r5lmdd.exe : tests.cpp parse.cpp regress.cpp
cl /MDd /D_MT /D_DLL $(CFLAGS) -o r5lmdd.exe -D__STL_DEBUG -DBOOST_RE_TEST_LOCALE_C -DTEST_UNICODE tests.cpp parse.cpp regress.cpp $(LFLAGS)
r6lmdd.exe : tests.cpp parse.cpp regress.cpp
cl /MDd /D_MT /D_DLL $(CFLAGS) -o r6lmdd.exe -D__STL_DEBUG -DBOOST_RE_TEST_LOCALE_CPP -DTEST_UNICODE tests.cpp parse.cpp regress.cpp $(LFLAGS)
r1mdd.exe : tests.cpp parse.cpp regress.cpp
cl /MTd /D_MT $(CFLAGS) -o r1mdd.exe -D__STL_DEBUG -DBOOST_RE_TEST_LOCALE_W32 tests.cpp parse.cpp regress.cpp $(LFLAGS)
r2mdd.exe : tests.cpp parse.cpp regress.cpp
cl /MTd /D_MT $(CFLAGS) -o r2mdd.exe -D__STL_DEBUG -DBOOST_RE_TEST_LOCALE_C tests.cpp parse.cpp regress.cpp $(LFLAGS)
r3mdd.exe : tests.cpp parse.cpp regress.cpp
cl /MTd /D_MT $(CFLAGS) -o r3mdd.exe -D__STL_DEBUG -DBOOST_RE_TEST_LOCALE_CPP tests.cpp parse.cpp regress.cpp $(LFLAGS)
r4mdd.exe : tests.cpp parse.cpp regress.cpp
cl /MTd /D_MT $(CFLAGS) -o r4mdd.exe -D__STL_DEBUG -DBOOST_RE_TEST_LOCALE_W32 -DTEST_UNICODE tests.cpp parse.cpp regress.cpp $(LFLAGS)
r5mdd.exe : tests.cpp parse.cpp regress.cpp
cl /MTd /D_MT $(CFLAGS) -o r5mdd.exe -D__STL_DEBUG -DBOOST_RE_TEST_LOCALE_C -DTEST_UNICODE tests.cpp parse.cpp regress.cpp $(LFLAGS)
r6mdd.exe : tests.cpp parse.cpp regress.cpp
cl /MTd /D_MT $(CFLAGS) -o r6mdd.exe -D__STL_DEBUG -DBOOST_RE_TEST_LOCALE_CPP -DTEST_UNICODE tests.cpp parse.cpp regress.cpp $(LFLAGS)

View File

@ -1,181 +0,0 @@
# very basic makefile for regression tests
#
# Visual C++ 6
#
CFLAGS= /Oityb1 /GF /Gy -GX -GR -I..\..\..\..\
LFLAGS= -link /LIBPATH:..\..\lib\vc6 user32.lib
all :: r1.exe r2.exe r3.exe r4.exe r5.exe r6.exe r1m.exe r2m.exe r3m.exe r4m.exe r5m.exe r6m.exe r1l.exe r2l.exe r3l.exe r4l.exe r5l.exe r6l.exe r1d.exe r2d.exe r3d.exe r4d.exe r5d.exe r6d.exe r1md.exe r2md.exe r3md.exe r4md.exe r5md.exe r6md.exe r1lmd.exe r2lmd.exe r3lmd.exe r4lmd.exe r5lmd.exe r6lmd.exe
echo testing static single threaded version....
r1 tests.txt test1252.txt
r2 tests.txt
r3 tests.txt
r4 tests.txt test1252.txt
r5 tests.txt
r6 tests.txt
echo testing static multi-threaded version....
r1m tests.txt test1252.txt
r2m tests.txt
r3m tests.txt
r4m tests.txt test1252.txt
r5m tests.txt
r6m tests.txt
echo testing DLL version....
r1l tests.txt test1252.txt
r2l tests.txt
r3l tests.txt
r4l tests.txt test1252.txt
r5l tests.txt
r6l tests.txt
echo testing static single threaded debug version....
r1d tests.txt test1252.txt
r2d tests.txt
r3d tests.txt
r4d tests.txt test1252.txt
r5d tests.txt
r6d tests.txt
echo testing static multi-threaded debug version....
r1md tests.txt test1252.txt
r2md tests.txt
r3md tests.txt
r4md tests.txt test1252.txt
r5md tests.txt
r6md tests.txt
echo testing dll debug version....
r1lmd tests.txt test1252.txt
r2lmd tests.txt
r3lmd tests.txt
r4lmd tests.txt test1252.txt
r5lmd tests.txt
r6lmd tests.txt
r1.exe : tests.cpp parse.cpp regress.cpp
cl /ML $(CFLAGS) -o r1.exe -DBOOST_RE_TEST_LOCALE_W32 tests.cpp parse.cpp regress.cpp $(LFLAGS)
r2.exe : tests.cpp parse.cpp regress.cpp
cl /ML $(CFLAGS) -o r2.exe -DBOOST_RE_TEST_LOCALE_C tests.cpp parse.cpp regress.cpp $(LFLAGS)
r3.exe : tests.cpp parse.cpp regress.cpp
cl /ML $(CFLAGS) -o r3.exe -DBOOST_RE_TEST_LOCALE_CPP tests.cpp parse.cpp regress.cpp $(LFLAGS)
r4.exe : tests.cpp parse.cpp regress.cpp
cl /ML $(CFLAGS) -o r4.exe -DBOOST_RE_TEST_LOCALE_W32 -DTEST_UNICODE tests.cpp parse.cpp regress.cpp $(LFLAGS)
r5.exe : tests.cpp parse.cpp regress.cpp
cl /ML $(CFLAGS) -o r5.exe -DBOOST_RE_TEST_LOCALE_C -DTEST_UNICODE tests.cpp parse.cpp regress.cpp $(LFLAGS)
r6.exe : tests.cpp parse.cpp regress.cpp
cl /ML $(CFLAGS) -o r6.exe -DBOOST_RE_TEST_LOCALE_CPP -DTEST_UNICODE tests.cpp parse.cpp regress.cpp $(LFLAGS)
r1m.exe : tests.cpp parse.cpp regress.cpp
cl /MT /D_MT -o r1m.exe $(CFLAGS) -DBOOST_RE_TEST_LOCALE_W32 tests.cpp parse.cpp regress.cpp $(LFLAGS)
r2m.exe : tests.cpp parse.cpp regress.cpp
cl /MT /D_MT $(CFLAGS) -o r2m.exe -DBOOST_RE_TEST_LOCALE_C tests.cpp parse.cpp regress.cpp $(LFLAGS)
r3m.exe : tests.cpp parse.cpp regress.cpp
cl /MT /D_MT $(CFLAGS) -o r3m.exe -DBOOST_RE_TEST_LOCALE_CPP tests.cpp parse.cpp regress.cpp $(LFLAGS)
r4m.exe : tests.cpp parse.cpp regress.cpp
cl /MT /D_MT $(CFLAGS) -o r4m.exe -DBOOST_RE_TEST_LOCALE_W32 -DTEST_UNICODE tests.cpp parse.cpp regress.cpp $(LFLAGS)
r5m.exe : tests.cpp parse.cpp regress.cpp
cl /MT /D_MT $(CFLAGS) -o r5m.exe -DBOOST_RE_TEST_LOCALE_C -DTEST_UNICODE tests.cpp parse.cpp regress.cpp $(LFLAGS)
r6m.exe : tests.cpp parse.cpp regress.cpp
cl /MT /D_MT $(CFLAGS) -o r6m.exe -DBOOST_RE_TEST_LOCALE_CPP -DTEST_UNICODE tests.cpp parse.cpp regress.cpp $(LFLAGS)
r1l.exe : tests.cpp parse.cpp regress.cpp
cl /MD /D_MT /D_DLL $(CFLAGS) -o r1l.exe -DBOOST_RE_TEST_LOCALE_W32 tests.cpp parse.cpp regress.cpp $(LFLAGS)
r2l.exe : tests.cpp parse.cpp regress.cpp
cl /MD /D_MT /D_DLL $(CFLAGS) -o r2l.exe -DBOOST_RE_TEST_LOCALE_C tests.cpp parse.cpp regress.cpp $(LFLAGS)
r3l.exe : tests.cpp parse.cpp regress.cpp
cl /MD /D_MT /D_DLL $(CFLAGS) -o r3l.exe -DBOOST_RE_TEST_LOCALE_CPP tests.cpp parse.cpp regress.cpp $(LFLAGS)
r4l.exe : tests.cpp parse.cpp regress.cpp
cl /MD /D_MT /D_DLL $(CFLAGS) -o r4l.exe -DBOOST_RE_TEST_LOCALE_W32 -DTEST_UNICODE tests.cpp parse.cpp regress.cpp $(LFLAGS)
r5l.exe : tests.cpp parse.cpp regress.cpp
cl /MD /D_MT /D_DLL $(CFLAGS) -o r5l.exe -DBOOST_RE_TEST_LOCALE_C -DTEST_UNICODE tests.cpp parse.cpp regress.cpp $(LFLAGS)
r6l.exe : tests.cpp parse.cpp regress.cpp
cl /MD /D_MT /D_DLL $(CFLAGS) -o r6l.exe -DBOOST_RE_TEST_LOCALE_CPP -DTEST_UNICODE tests.cpp parse.cpp regress.cpp $(LFLAGS)
r1d.exe : tests.cpp parse.cpp regress.cpp
cl /MLd $(CFLAGS) -o r1d.exe -DBOOST_RE_TEST_LOCALE_W32 tests.cpp parse.cpp regress.cpp $(LFLAGS)
r2d.exe : tests.cpp parse.cpp regress.cpp
cl /MLd $(CFLAGS) -o r2d.exe -DBOOST_RE_TEST_LOCALE_C tests.cpp parse.cpp regress.cpp $(LFLAGS)
r3d.exe : tests.cpp parse.cpp regress.cpp
cl /MLd $(CFLAGS) -o r3d.exe -DBOOST_RE_TEST_LOCALE_CPP tests.cpp parse.cpp regress.cpp $(LFLAGS)
r4d.exe : tests.cpp parse.cpp regress.cpp
cl /MLd $(CFLAGS) -o r4d.exe -DBOOST_RE_TEST_LOCALE_W32 -DTEST_UNICODE tests.cpp parse.cpp regress.cpp $(LFLAGS)
r5d.exe : tests.cpp parse.cpp regress.cpp
cl /MLd $(CFLAGS) -o r5d.exe -DBOOST_RE_TEST_LOCALE_C -DTEST_UNICODE tests.cpp parse.cpp regress.cpp $(LFLAGS)
r6d.exe : tests.cpp parse.cpp regress.cpp
cl /MLd $(CFLAGS) -o r6d.exe -DBOOST_RE_TEST_LOCALE_CPP -DTEST_UNICODE tests.cpp parse.cpp regress.cpp $(LFLAGS)
r1md.exe : tests.cpp parse.cpp regress.cpp
cl /MTd /D_MT $(CFLAGS) -o r1md.exe -DBOOST_RE_TEST_LOCALE_W32 tests.cpp parse.cpp regress.cpp $(LFLAGS)
r2md.exe : tests.cpp parse.cpp regress.cpp
cl /MTd /D_MT $(CFLAGS) -o r2md.exe -DBOOST_RE_TEST_LOCALE_C tests.cpp parse.cpp regress.cpp $(LFLAGS)
r3md.exe : tests.cpp parse.cpp regress.cpp
cl /MTd /D_MT $(CFLAGS) -o r3md.exe -DBOOST_RE_TEST_LOCALE_CPP tests.cpp parse.cpp regress.cpp $(LFLAGS)
r4md.exe : tests.cpp parse.cpp regress.cpp
cl /MTd /D_MT $(CFLAGS) -o r4md.exe -DBOOST_RE_TEST_LOCALE_W32 -DTEST_UNICODE tests.cpp parse.cpp regress.cpp $(LFLAGS)
r5md.exe : tests.cpp parse.cpp regress.cpp
cl /MTd /D_MT $(CFLAGS) -o r5md.exe -DBOOST_RE_TEST_LOCALE_C -DTEST_UNICODE tests.cpp parse.cpp regress.cpp $(LFLAGS)
r6md.exe : tests.cpp parse.cpp regress.cpp
cl /MTd /D_MT $(CFLAGS) -o r6md.exe -DBOOST_RE_TEST_LOCALE_CPP -DTEST_UNICODE tests.cpp parse.cpp regress.cpp $(LFLAGS)
r1lmd.exe : tests.cpp parse.cpp regress.cpp
cl /MDd /D_MT /D_DLL $(CFLAGS) -o r1lmd.exe -DBOOST_RE_TEST_LOCALE_W32 tests.cpp parse.cpp regress.cpp $(LFLAGS)
r2lmd.exe : tests.cpp parse.cpp regress.cpp
cl /MDd /D_MT /D_DLL $(CFLAGS) -o r2lmd.exe -DBOOST_RE_TEST_LOCALE_C tests.cpp parse.cpp regress.cpp $(LFLAGS)
r3lmd.exe : tests.cpp parse.cpp regress.cpp
cl /MDd /D_MT /D_DLL $(CFLAGS) -o r3lmd.exe -DBOOST_RE_TEST_LOCALE_CPP tests.cpp parse.cpp regress.cpp $(LFLAGS)
r4lmd.exe : tests.cpp parse.cpp regress.cpp
cl /MDd /D_MT /D_DLL $(CFLAGS) -o r4lmd.exe -DBOOST_RE_TEST_LOCALE_W32 -DTEST_UNICODE tests.cpp parse.cpp regress.cpp $(LFLAGS)
r5lmd.exe : tests.cpp parse.cpp regress.cpp
cl /MDd /D_MT /D_DLL $(CFLAGS) -o r5lmd.exe -DBOOST_RE_TEST_LOCALE_C -DTEST_UNICODE tests.cpp parse.cpp regress.cpp $(LFLAGS)
r6lmd.exe : tests.cpp parse.cpp regress.cpp
cl /MDd /D_MT /D_DLL $(CFLAGS) -o r6lmd.exe -DBOOST_RE_TEST_LOCALE_CPP -DTEST_UNICODE tests.cpp parse.cpp regress.cpp $(LFLAGS)

View File

@ -1,196 +0,0 @@
/*
*
* Copyright (c) 1998-2000
* Dr John Maddock
*
* Permission to use, copy, modify, distribute and sell this software
* and its documentation for any purpose is hereby granted without fee,
* provided that the above copyright notice appear in all copies and
* that both that copyright notice and this permission notice appear
* in supporting documentation. Dr John Maddock makes no representations
* about the suitability of this software for any purpose.
* It is provided "as is" without express or implied warranty.
*
*/
/*
* LOCATION: see http://www.boost.org for most recent version.
* FILE regex_test.cpp
* VERSION 3.03
* DESCRIPTION: Builds regression test program with default
* locale and wide character tests. Also
* instantiates all the templates in the library
* as a sanity check.
*/
// disable automatic selection of support library:
#define BOOST_RE_NO_LIB
#include <boost/regex.hpp>
//
// instantiate templates used:
//
namespace boost{
typedef const wchar_t* ra_it;
typedef wchar_t char_type;
typedef std::basic_string<char_type> test_string_type;
bool pred1(const match_results<ra_it>&)
{ return true; }
typedef bool (*pred1_type)(const match_results<ra_it>&);
typedef bool (*pred2_type)(const match_results<test_string_type::const_iterator>&);
//check that all the defined flags are available:
regbase::flag_type f = regbase::escape_in_lists | regbase::char_classes | regbase::intervals | regbase::limited_ops
| regbase::newline_alt | regbase::bk_plus_qm | regbase::bk_braces
| regbase::bk_parens | regbase::bk_refs | regbase::bk_vbar | regbase::use_except
| regbase::failbit | regbase::literal | regbase::icase | regbase::nocollate | regbase::basic
| regbase::extended | regbase::normal | regbase::emacs | regbase::awk | regbase::grep | regbase::egrep | regbase::sed;
template class reg_expression<char_type>;
template struct sub_match<ra_it>;
template class match_results<ra_it>;
template bool regex_match(ra_it,
ra_it,
match_results<ra_it>& m,
const reg_expression<char_type>& e,
unsigned flags);
template bool regex_match(ra_it,
ra_it,
const reg_expression<char_type>& e,
unsigned flags);
template bool regex_search(ra_it,
ra_it,
match_results<ra_it>& m,
const reg_expression<char_type>& e,
unsigned flags);
template unsigned int regex_grep(pred1_type,
ra_it,
ra_it,
const reg_expression<char_type>& e,
unsigned flags);
template char_type* regex_format(char_type*,
const match_results<ra_it>& m,
const char_type* fmt,
unsigned flags);
template char_type* regex_format(char_type*,
const match_results<ra_it>& m,
const test_string_type& fmt,
unsigned flags);
template char_type* regex_merge(char_type*,
ra_it,
ra_it,
const reg_expression<char_type>&,
const char_type*,
unsigned int flags);
template char_type* regex_merge(char_type*,
ra_it,
ra_it,
const reg_expression<char_type>& e,
const test_string_type&,
unsigned int flags);
template std::size_t regex_split(test_string_type*,
test_string_type&,
const reg_expression<char_type>&,
unsigned flags,
std::size_t);
template std::size_t regex_split(test_string_type*,
test_string_type& s,
const reg_expression<char_type>& e,
unsigned flags);
template std::size_t regex_split(test_string_type*, test_string_type&);
#ifndef BOOST_RE_NO_PARTIAL_FUNC_SPEC
//
// the following prototypes are only available if partial ordering
// of template functions is supported:
//
template bool regex_match(const char_type*,
match_results<const char_type*>& m,
const reg_expression<char_type>& e,
unsigned flags);
template bool regex_match(const test_string_type&,
match_results<test_string_type::const_iterator>&,
const reg_expression<char_type>&,
unsigned flags);
template bool regex_match(const char_type*,
const reg_expression<char_type>&,
unsigned flags);
template bool regex_match(const test_string_type&,
const reg_expression<char_type>&,
unsigned flags);
template bool regex_search(const char_type*,
match_results<const char_type*>&,
const reg_expression<char_type>&,
unsigned flags);
template bool regex_search(const test_string_type&,
match_results<test_string_type::const_iterator>&,
const reg_expression<char_type>&,
unsigned flags);
template unsigned int regex_grep(pred1_type,
const char_type*,
const reg_expression<char_type>&,
unsigned flags);
template unsigned int regex_grep(pred2_type,
const test_string_type&,
const reg_expression<char_type>&,
unsigned flags);
template test_string_type regex_format
(const match_results<test_string_type::const_iterator>& m,
const char_type*,
unsigned flags);
template test_string_type regex_format
(const match_results<test_string_type::const_iterator>&,
const test_string_type&,
unsigned flags);
template test_string_type regex_merge(const test_string_type&,
const reg_expression<char_type>&,
const char_type*,
unsigned int flags);
template test_string_type regex_merge(const test_string_type&,
const reg_expression<char_type>&,
const test_string_type&,
unsigned int flags);
#endif
} // namespace boost
//
// include regression test source files:
//
#ifdef BOOST_RE_LOCALE_W32
#define BOOST_RE_TEST_LOCALE_W32
#elif !defined(BOOST_RE_LOCALE_C)
#define BOOST_RE_TEST_LOCALE_CPP
#endif
#define TEST_UNICODE
#include "tests.cpp"
#include "parse.cpp"
#include "regress.cpp"
//
// include library source files:
//
#ifdef BOOST_RE_LOCALE_W32
#include "libs/regex/src/w32_regex_traits.cpp"
#elif defined(BOOST_RE_LOCALE_C)
#include "libs/regex/src/c_regex_traits.cpp"
#else
#include "libs/regex/src/cpp_regex_traits.cpp"
#endif
#include "libs/regex/src/c_regex_traits_common.cpp"
#include "libs/regex/src/cregex.cpp"
#include "libs/regex/src/fileiter.cpp"
#include "libs/regex/src/regex.cpp"
#include "libs/regex/src/regex_debug.cpp"
#include "libs/regex/src/regex_synch.cpp"
#include "libs/regex/src/wide_posix_api.cpp"

View File

@ -1,100 +0,0 @@
/*
*
* Copyright (c) 1998-2000
* Dr John Maddock
*
* Permission to use, copy, modify, distribute and sell this software
* and its documentation for any purpose is hereby granted without fee,
* provided that the above copyright notice appear in all copies and
* that both that copyright notice and this permission notice appear
* in supporting documentation. Dr John Maddock makes no representations
* about the suitability of this software for any purpose.
* It is provided "as is" without express or implied warranty.
*
*/
/*
* LOCATION: see http://www.boost.org for most recent version.
* FILE snip1.cpp
* VERSION 3.00
* DESCRIPTION: ftp based regex_match example.
*/
#include <cstdlib>
#include <boost/regex.hpp>
#include <string>
#include <iostream>
using namespace std;
using namespace boost;
regex expression("^([0-9]+)(\\-| |$)(.*)$");
// process_ftp:
// on success returns the ftp response code, and fills
// msg with the ftp response message.
int process_ftp(const char* response, std::string* msg)
{
cmatch what;
if(regex_match(response, what, expression))
{
// what[0] contains the whole string
// what[1] contains the response code
// what[2] contains the separator character
// what[3] contains the text message.
if(msg)
msg->assign(what[3].first, what[3].second);
return atoi(what[1].first);
}
// failure did not match
if(msg)
msg->erase();
return -1;
}
#if defined(BOOST_MSVC) || (defined(__BORLANDC__) && (__BORLANDC__ == 0x550))
//
// problem with std::getline under MSVC6sp3
istream& getline(istream& is, std::string& s)
{
s.erase();
char c = is.get();
while(c != '\n')
{
s.append(1, c);
c = is.get();
}
return is;
}
#endif
int main()
{
std::string in, out;
while(true)
{
cout << "enter test string" << endl;
getline(cin, in);
if(in == "quit")
break;
int result;
result = process_ftp(in.c_str(), &out);
if(result != -1)
{
cout << "Match found:" << endl;
cout << "Response code: " << result << endl;
cout << "Message text: " << out << endl;
}
else
{
cout << "Match not found" << endl;
}
cout << endl;
}
return 0;
}

View File

@ -1,31 +0,0 @@
# very basic makefile for timer.exe
#
# GNU compiler GCC
#
CXX=-I../../../../ -I./
timer : regex_timer.cpp
g++ $(CXX) -O2 -o timer regex_timer.cpp -L../../lib/gcc -lregex++
debug : regex_timer.cpp timer.cpp
g++ $(CXX) -g -o timer regex_timer.cpp -L../../lib/gcc -lregex++debug

View File

@ -1,38 +0,0 @@
# very basic makefile for timer
#
CXX=@CXX@
CXXFLAGS=@CXXFLAGS@
LIBS=@LIBS@
EXE=@ac_exe_ext@
OBJ=@ac_obj_ext@
LIBDEP=../../lib/libregex++.a ../../../../boost/re_detail/regex_options.hpp ../../../../boost/re_detail/regex_config.hpp
regex_timer$(EXE) : regex_timer$(OBJ)
$(CXX) -o timer$(EXE) regex_timer$(OBJ) -L../../lib -lregex++ $(LIBS)
regex_timer$(OBJ) : regex_timer.cpp $(LIBDEP)
$(CXX) -c $(CXXFLAGS) -DSTRICT -I../../../../ -I./ regex_timer.cpp
timer$(OBJ) : ../../../timer/timer.cpp $(LIBDEP)
$(CXX) -c $(CXXFLAGS) -DSTRICT -I../../../../ -I./ ../../../timer/timer.cpp

View File

@ -1,24 +0,0 @@
# Makefile for timer application
#
# for SUN workshop 5.0 C++ compiler
#
CXX=CC
CPP_FLAGS = -O -I../../../../ -I./
%.o : %.cpp
$(CXX) -c -o $@ $(CPP_FLAGS) $<
timer : regex_timer.o
$(CXX) -o $@ $(CPP_FLAGS) regex_timer.o -L../../lib -lregex++
timer.o : ../../../timer/timer.cpp
$(CXX) -c $(CPPFLAGS) ../../../timer/timer.cpp
clean:
rm -rf SunWS_cache
rm -f timer.o timer

14
dmi.sh
View File

@ -1,14 +0,0 @@
#! /bin/sh
if test "$#" != "1"; then
exit 1
fi
cd "$1"
if eval make; then
exit 0
fi
exit 1

58
doc/Jamfile.v2 Normal file
View File

@ -0,0 +1,58 @@
# Copyright John Maddock 2005. Use, modification, and distribution are
# subject to the Boost Software License, Version 1.0. (See accompanying
# file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
using quickbook ;
path-constant boost-images : ../../../doc/src/images ;
xml regex : regex.qbk ;
boostbook standalone
:
regex
:
# HTML options first:
# Use graphics not text for navigation:
<xsl:param>navig.graphics=1
# How far down we chunk nested sections, basically all of them:
<xsl:param>chunk.section.depth=10
# Don't put the first section on the same page as the TOC:
<xsl:param>chunk.first.sections=1
# How far down sections get TOC's
<xsl:param>toc.section.depth=10
# Max depth in each TOC:
<xsl:param>toc.max.depth=4
# How far down we go with TOC's
<xsl:param>generate.section.toc.level=10
# Path for links to Boost:
<xsl:param>boost.root=../../../..
# PDF Options:
# TOC Generation: this is needed for FOP-0.9 and later:
<xsl:param>fop1.extensions=0
# Or enable this if you're using XEP:
<xsl:param>xep.extensions=1
# TOC generation: this is needed for FOP 0.2, but must not be set to zero for FOP-0.9!
<xsl:param>fop.extensions=0
# No indent on body text:
<xsl:param>body.start.indent=0pt
# Margin size:
<xsl:param>page.margin.inner=0.5in
# Margin size:
<xsl:param>page.margin.outer=0.5in
# Yes, we want graphics for admonishments:
<xsl:param>admon.graphics=1
# Set this one for PDF generation *only*:
# default pnd graphics are awful in PDF form,
# better use SVG's instead:
<format>pdf:<xsl:param>admon.graphics.extension=".svg"
<format>pdf:<xsl:param>admon.graphics.path=$(boost-images)/
<format>pdf:<xsl:param>boost.url.prefix=http://www.boost.org/doc/libs/release/libs/regex/doc/html
;
###############################################################################
alias boostdoc ;
explicit boostdoc ;
alias boostrelease : standalone ;
explicit boostrelease ;

49
doc/acknowledgements.qbk Normal file
View File

@ -0,0 +1,49 @@
[/
Copyright 2006-2007 John Maddock.
Distributed under the Boost Software License, Version 1.0.
(See accompanying file LICENSE_1_0.txt or copy at
http://www.boost.org/LICENSE_1_0.txt).
]
[section:acknowledgements Acknowledgements]
The author can be contacted at john - at - johnmaddock.co.uk; the home page for this
library is at [@http://www.boost.org www.boost.org].
I am indebted to [@http://www.cs.princeton.edu/~rs/
Robert Sedgewick's "Algorithms in C++"] for forcing me to think
about algorithms and their performance, and to the folks at boost for forcing me
to think, period.
[@http://www.boost-consulting.com/ Eric Niebler], author of Boost.Expressive and
the [@http://research.microsoft.com/projects/greta GRETA regular expression component],
has shared several important ideas, in a series of long discussions.
Pete Becker, of [@http://www.versatilecoding.com Roundhouse Consulting, Ltd.],
has helped enormously with the standardisation
proposal language.
The following people have all contributed useful comments or fixes: Dave Abrahams,
Mike Allison, Edan Ayal, Jayashree Balasubramanian, Jan B'''&#xF6;'''lsche, Beman Dawes,
Paul Baxter, David Bergman, David Dennerline, Edward Diener, Peter Dimov,
Robert Dunn, Fabio Forno, Tobias Gabrielsson, Rob Gillen, Marc Gregoire, Chris Hecker,
Nick Hodapp, Jesse Jones, Martin Jost, Boris Krasnovskiy, Jan Hermelink, Max Leung,
Wei-hao Lin, Jens Maurer, Richard Peters, Heiko Schmidt, Jason Shirk, Gerald Slacik,
Scobie Smith, Mike Smyth, Alexander Sokolovsky, Herv'''&#xE9;''' Poirier, Michael Raykh,
Marc Recht, Scott VanCamp, Bruno Voigt, Alexey Voinov, Jerry Waldorf, Rob Ward,
Lealon Watts, John Wismar, Thomas Witt and Yuval Yosef.
If I've missed your name off (I'm sure there are a few, just not who they are...) then
please do get in touch.
I am also grateful to the manuals supplied with the Henry Spencer, PCRE, Perl
and GNU regular expression libraries - wherever possible I have tried to
maintain compatibility with these libraries and with the POSIX standard -
the code however is entirely my own, including any bugs! I can absolutely guarantee
that I will not fix any bugs I don't know about, so if you have any comments or
spot any bugs, please get in touch.
[endsect]

58
doc/bad_expression.qbk Normal file
View File

@ -0,0 +1,58 @@
[/
Copyright 2006-2007 John Maddock.
Distributed under the Boost Software License, Version 1.0.
(See accompanying file LICENSE_1_0.txt or copy at
http://www.boost.org/LICENSE_1_0.txt).
]
[section:bad_expression bad_expression]
[h4 Synopsis]
#include <boost/pattern_except.hpp>
The class `regex_error` defines the type of objects thrown as exceptions to
report errors during the conversion from a string representing a regular
expression to a finite state machine.
namespace boost{
class regex_error : public std::runtime_error
{
public:
explicit regex_error(const std::string& s, regex_constants::error_type err, std::ptrdiff_t pos);
explicit regex_error(boost::regex_constants::error_type err);
boost::regex_constants::error_type code()const;
std::ptrdiff_t position()const;
};
typedef regex_error bad_pattern; // for backwards compatibility
typedef regex_error bad_expression; // for backwards compatibility
} // namespace boost
[h4 Description]
regex_error(const std::string& s, regex_constants::error_type err, std::ptrdiff_t pos);
regex_error(boost::regex_constants::error_type err);
[*Effects:] Constructs an object of class regex_error.
boost::regex_constants::error_type code()const;
[*Effects:] returns the error code that represents parsing error that occurred.
std::ptrdiff_t position()const;
[*Effects:] returns the location in the expression where parsing stopped.
Footnotes: the choice of `std::runtime_error` as the base class for `regex_error`
is moot; depending upon how the library is used exceptions may be either
logic errors (programmer supplied expressions) or run time errors
(user supplied expressions). The library previously used `bad_pattern`
and `bad_expression` for errors, these have been replaced by the single
class `regex_error` to keep the library in synchronization with the
[tr1].
[endsect]

680
doc/basic_regex.qbk Normal file
View File

@ -0,0 +1,680 @@
[/
Copyright 2006-2007 John Maddock.
Distributed under the Boost Software License, Version 1.0.
(See accompanying file LICENSE_1_0.txt or copy at
http://www.boost.org/LICENSE_1_0.txt).
]
[section:basic_regex basic_regex]
[h4 Synopsis]
#include <boost/regex.hpp>
The template class `basic_regex` encapsulates regular expression
parsing and compilation. The class takes two template parameters:
* `charT`: determines the character type, i.e. either `char` or `wchar_t`;
see [link boost_regex.ref.concepts.charT_concept charT concept].
* `traits`: determines the behavior of the character type, for example which
character class names are recognized. A default traits class is provided:
`regex_traits<charT>`. See also
[link boost_regex.ref.concepts.traits_concept traits concept].
For ease of use there are two typedefs that define the two standard
`basic_regex` instances, unless you want to use custom traits classes or
non-standard character types (for example see
[link boost_regex.ref.non_std_strings.icu unicode support]),
you won't need to use anything other than these:
namespace boost{
template <class charT, class traits = regex_traits<charT> >
class basic_regex;
typedef basic_regex<char> regex;
typedef basic_regex<wchar_t> wregex;
}
The definition of `basic_regex` follows: it is based very closely on class
`basic_string`, and fulfils the requirements for a constant-container of `charT`.
namespace boost{
template <class charT, class traits = regex_traits<charT> >
class basic_regex {
public:
// types:
typedef charT value_type;
typedef implementation-specific const_iterator;
typedef const_iterator iterator;
typedef charT& reference;
typedef const charT& const_reference;
typedef std::ptrdiff_t difference_type;
typedef std::size_t size_type;
typedef regex_constants::``[syntax_option_type]`` flag_type;
typedef typename traits::locale_type locale_type;
// constants:
// main option selection:
static const regex_constants::``[syntax_option_type]`` normal
= regex_constants::normal;
static const regex_constants::``[syntax_option_type]`` ECMAScript
= normal;
static const regex_constants::``[syntax_option_type]`` JavaScript
= normal;
static const regex_constants::``[syntax_option_type]`` JScript
= normal;
static const regex_constants::``[syntax_option_type]`` basic
= regex_constants::basic;
static const regex_constants::``[syntax_option_type]`` extended
= regex_constants::extended;
static const regex_constants::``[syntax_option_type]`` awk
= regex_constants::awk;
static const regex_constants::``[syntax_option_type]`` grep
= regex_constants::grep;
static const regex_constants::``[syntax_option_type]`` egrep
= regex_constants::egrep;
static const regex_constants::``[syntax_option_type]`` sed
= basic = regex_constants::sed;
static const regex_constants::``[syntax_option_type]`` perl
= regex_constants::perl;
static const regex_constants::``[syntax_option_type]`` literal
= regex_constants::literal;
// modifiers specific to perl expressions:
static const regex_constants::``[syntax_option_type]`` no_mod_m
= regex_constants::no_mod_m;
static const regex_constants::``[syntax_option_type]`` no_mod_s
= regex_constants::no_mod_s;
static const regex_constants::``[syntax_option_type]`` mod_s
= regex_constants::mod_s;
static const regex_constants::``[syntax_option_type]`` mod_x
= regex_constants::mod_x;
// modifiers specific to POSIX basic expressions:
static const regex_constants::``[syntax_option_type]`` bk_plus_qm
= regex_constants::bk_plus_qm;
static const regex_constants::``[syntax_option_type]`` bk_vbar
= regex_constants::bk_vbar
static const regex_constants::``[syntax_option_type]`` no_char_classes
= regex_constants::no_char_classes
static const regex_constants::``[syntax_option_type]`` no_intervals
= regex_constants::no_intervals
// common modifiers:
static const regex_constants::``[syntax_option_type]`` nosubs
= regex_constants::nosubs;
static const regex_constants::``[syntax_option_type]`` optimize
= regex_constants::optimize;
static const regex_constants::``[syntax_option_type]`` collate
= regex_constants::collate;
static const regex_constants::``[syntax_option_type]`` newline_alt
= regex_constants::newline_alt;
static const regex_constants::``[syntax_option_type]`` no_except
= regex_constants::newline_alt;
// construct/copy/destroy:
explicit ``[link boost_regex.basic_regex.construct1 basic_regex]`` ();
explicit ``[link boost_regex.basic_regex.construct2 basic_regex]``(const charT* p, flag_type f = regex_constants::normal);
``[link boost_regex.basic_regex.construct3 basic_regex]``(const charT* p1, const charT* p2,
flag_type f = regex_constants::normal);
``[link boost_regex.basic_regex.construct4 basic_regex]``(const charT* p, size_type len, flag_type f);
``[link boost_regex.basic_regex.construct5 basic_regex]``(const basic_regex&);
template <class ST, class SA>
explicit ``[link boost_regex.basic_regex.construct6 basic_regex]``(const basic_string<charT, ST, SA>& p,
flag_type f = regex_constants::normal);
template <class InputIterator>
``[link boost_regex.basic_regex.construct7 basic_regex]``(InputIterator first, InputIterator last,
flag_type f = regex_constants::normal);
~basic_regex();
``[link boost_regex.basic_regex.opeq1 basic_regex& operator=]``(const basic_regex&);
``[link boost_regex.basic_regex.opeq2 basic_regex& operator=]`` (const charT* ptr);
template <class ST, class SA>
``[link boost_regex.basic_regex.opeq3 basic_regex& operator=]`` (const basic_string<charT, ST, SA>& p);
// iterators:
``[link boost_regex.basic_regex.subexpression std::pair<const_iterator, const_iterator> subexpression]``(size_type n) const;
``[link boost_regex.basic_regex.begin const_iterator begin]``() const;
``[link boost_regex.basic_regex.end const_iterator end]``() const;
// capacity:
``[link boost_regex.basic_regex.size size_type size]``() const;
``[link boost_regex.basic_regex.max_size size_type max_size]``() const;
``[link boost_regex.basic_regex.empty bool empty]``() const;
``[link boost_regex.basic_regex.mark_count size_type mark_count]``()const;
//
// modifiers:
``[link boost_regex.basic_regex.assign1 basic_regex& assign]``(const basic_regex& that);
``[link boost_regex.basic_regex.assign2 basic_regex& assign]``(const charT* ptr,
flag_type f = regex_constants::normal);
``[link boost_regex.basic_regex.assign3 basic_regex& assign]``(const charT* ptr, unsigned int len, flag_type f);
template <class string_traits, class A>
``[link boost_regex.basic_regex.assign4 basic_regex& assign]``(const basic_string<charT, string_traits, A>& s,
flag_type f = regex_constants::normal);
template <class InputIterator>
``[link boost_regex.basic_regex.assign5 basic_regex& assign]``(InputIterator first, InputIterator last,
flag_type f = regex_constants::normal);
// const operations:
``[link boost_regex.basic_regex.flags flag_type flags]``() const;
``[link boost_regex.basic_regex.status int status]``()const;
``[link boost_regex.basic_regex.str basic_string<charT> str]``() const;
``[link boost_regex.basic_regex.compare int compare]``(basic_regex&) const;
// locale:
``[link boost_regex.basic_regex.imbue locale_type imbue]``(locale_type loc);
``[link boost_regex.basic_regex.getloc locale_type getloc]``() const;
// swap
``[link boost_regex.basic_regex.swap void swap]``(basic_regex&) throw();
};
template <class charT, class traits>
``[link boost_regex.basic_regex.op_eq bool operator ==]`` (const basic_regex<charT, traits>& lhs,
const basic_regex<charT, traits>& rhs);
template <class charT, class traits>
``[link boost_regex.basic_regex.op_ne bool operator !=]`` (const basic_regex<charT, traits>& lhs,
const basic_regex<charT, traits>& rhs);
template <class charT, class traits>
``[link boost_regex.basic_regex.op_lt bool operator <]`` (const basic_regex<charT, traits>& lhs,
const basic_regex<charT, traits>& rhs);
template <class charT, class traits>
``[link boost_regex.basic_regex.op_le bool operator <=]`` (const basic_regex<charT, traits>& lhs,
const basic_regex<charT, traits>& rhs);
template <class charT, class traits>
``[link boost_regex.basic_regex.op_ge bool operator >=]`` (const basic_regex<charT, traits>& lhs,
const basic_regex<charT, traits>& rhs);
template <class charT, class traits>
``[link boost_regex.basic_regex.op_gt bool operator >]`` (const basic_regex<charT, traits>& lhs,
const basic_regex<charT, traits>& rhs);
template <class charT, class io_traits, class re_traits>
basic_ostream<charT, io_traits>&
``[link boost_regex.basic_regex.op_stream operator <<]`` (basic_ostream<charT, io_traits>& os,
const basic_regex<charT, re_traits>& e);
template <class charT, class traits>
``[link boost_regex.basic_regex.op_swap void swap]``(basic_regex<charT, traits>& e1,
basic_regex<charT, traits>& e2);
typedef basic_regex<char> regex;
typedef basic_regex<wchar_t> wregex;
} // namespace boost
[h4 Description]
Class `basic_regex` has the following public members:
// main option selection:
static const regex_constants::``[syntax_option_type]`` normal
= regex_constants::normal;
static const regex_constants::``[syntax_option_type]`` ECMAScript
= normal;
static const regex_constants::``[syntax_option_type]`` JavaScript
= normal;
static const regex_constants::``[syntax_option_type]`` JScript
= normal;
static const regex_constants::``[syntax_option_type]`` basic
= regex_constants::basic;
static const regex_constants::``[syntax_option_type]`` extended
= regex_constants::extended;
static const regex_constants::``[syntax_option_type]`` awk
= regex_constants::awk;
static const regex_constants::``[syntax_option_type]`` grep
= regex_constants::grep;
static const regex_constants::``[syntax_option_type]`` egrep
= regex_constants::egrep;
static const regex_constants::``[syntax_option_type]`` sed
= regex_constants::sed;
static const regex_constants::``[syntax_option_type]`` perl
= regex_constants::perl;
static const regex_constants::``[syntax_option_type]`` literal
= regex_constants::literal;
// modifiers specific to perl expressions:
static const regex_constants::``[syntax_option_type]`` no_mod_m
= regex_constants::no_mod_m;
static const regex_constants::``[syntax_option_type]`` no_mod_s
= regex_constants::no_mod_s;
static const regex_constants::``[syntax_option_type]`` mod_s
= regex_constants::mod_s;
static const regex_constants::``[syntax_option_type]`` mod_x
= regex_constants::mod_x;
// modifiers specific to POSIX basic expressions:
static const regex_constants::``[syntax_option_type]`` bk_plus_qm
= regex_constants::bk_plus_qm;
static const regex_constants::``[syntax_option_type]`` bk_vbar
= regex_constants::bk_vbar
static const regex_constants::``[syntax_option_type]`` no_char_classes
= regex_constants::no_char_classes
static const regex_constants::``[syntax_option_type]`` no_intervals
= regex_constants::no_intervals
// common modifiers:
static const regex_constants::``[syntax_option_type]`` nosubs
= regex_constants::nosubs;
static const regex_constants::``[syntax_option_type]`` optimize
= regex_constants::optimize;
static const regex_constants::``[syntax_option_type]`` collate
= regex_constants::collate;
static const regex_constants::``[syntax_option_type]`` newline_alt
= regex_constants::newline_alt;
The meaning of these options is documented in the [syntax_option_type]
section.
The static constant members are provided as synonyms for the constants declared
in namespace `boost::regex_constants`; for each constant of type [syntax_option_type]
declared in namespace `boost::regex_constants` then a constant with the same name,
type and value is declared within the scope of basic_regex.
[#boost_regex.basic_regex.construct1]
basic_regex();
[*Effects]: Constructs an object of class `basic_regex`.
[table basic_regex default construction postconditions
[[Element][Value]]
[[`empty()`][`true`]]
[[`size()`][`0`]]
[[`str()`][`basic_string<charT>()`]]
]
[#boost_regex.basic_regex.construct2]
basic_regex(const charT* p, flag_type f = regex_constants::normal);
[*Requires]: /p/ shall not be a null pointer.
[*Throws]: [bad_expression] if /p/ is not a valid regular expression,
unless the flag `no_except` is set in /f/.
[*Effects]: Constructs an object of class [basic_regex]; the object's internal
finite state machine is constructed from the regular expression contained
in the null-terminated string /p/, and interpreted according to the
[link boost_regex.ref.syntax_option_type option
flags] specified in /f/.
[table Postconditions for basic_regex construction
[[Element][Value]]
[[`empty()`][`false`]]
[[`size()`][`char_traits<charT>::length(p)`]]
[[`str()`][`basic_string<charT>(p)`]]
[[`flags()`][['f]]]
[[`mark_count()`][The number of marked sub-expressions within the expression.]]
]
[#boost_regex.basic_regex.construct3]
basic_regex(const charT* p1, const charT* p2,
flag_type f = regex_constants::normal);
[*Requires]: /p1/ and /p2/ are not null pointers, `p1 < p2`.
[*Throws]: bad_expression if \[p1,p2) is not a valid regular expression, unless
the flag `no_except` is set in /f/.
[*Effects]: Constructs an object of class [basic_regex]; the object's
internal finite state machine is constructed from the regular expression
contained in the sequence of characters \[p1,p2), and interpreted according the
[link boost_regex.ref.syntax_option_type option flags] specified in /f/.
[table Postconditions for basic_regex construction
[[Element][Value]]
[[`empty()`][`false`]]
[[`size()`][`std::distance(p1,p2)`]]
[[`str()`][`basic_string<charT>(p1,p2)`]]
[[`flags()`][['f]]]
[[`mark_count()`][The number of marked sub-expressions within the expression.]]
]
[#boost_regex.basic_regex.construct4]
basic_regex(const charT* p, size_type len, flag_type f);
[*Requires]: /p/ shall not be a null pointer, `len < max_size()`.
[*Throws]: [bad_expression] if /p/ is not a valid regular expression, unless
the flag `no_except` is set in /f/.
[*Effects]: Constructs an object of class [basic_regex]; the object's
internal finite state machine is constructed from the regular expression
contained in the sequence of characters \[p, p+len), and interpreted
according the option flags specified in /f/.
[table Postconditions for basic_regex construction
[[Element][Value]]
[[`empty()`][`false`]]
[[`size()`][['len]]]
[[`str()`][`basic_string<charT>(p, len)`]]
[[`flags()`][['f]]]
[[`mark_count()`][The number of marked sub-expressions within the expression.]]
]
[#boost_regex.basic_regex.construct5]
basic_regex(const basic_regex& e);
[*Effects]: Constructs an object of class [basic_regex] as a copy of the object
/e/.
[#boost_regex.basic_regex.construct6]
template <class ST, class SA>
basic_regex(const basic_string<charT, ST, SA>& s,
flag_type f = regex_constants::normal);
[*Throws]: [bad_expression] if /s/ is not a valid regular expression,
unless the flag `no_except` is set in /f/.
[*Effects]: Constructs an object of class [basic_regex]; the object's
internal finite state machine is constructed from the regular expression
contained in the string /s/, and interpreted according to the [link boost_regex.ref.syntax_option_type option
flags] specified in /f/.
[table Postconditions for basic_regex construction
[[Element][Value]]
[[`empty()`][`false`]]
[[`size()`][`s.size()`]]
[[`str()`][['s]]]
[[`flags()`][['f]]]
[[`mark_count()`][The number of marked sub-expressions within the expression.]]
]
[#boost_regex.basic_regex.construct7]
template <class ForwardIterator>
basic_regex(ForwardIterator first, ForwardIterator last,
flag_type f = regex_constants::normal);
[*Throws]: [bad_expression] if the sequence \[first, last) is not a valid
regular expression, unless the flag `no_except` is set in /f/.
[*Effects]: Constructs an object of class [basic_regex]; the object's
internal finite state machine is constructed from the regular expression
contained in the sequence of characters \[first, last), and interpreted
according to the [link boost_regex.ref.syntax_option_type option flags] specified in /f/.
[table Postconditions for basic_regex construction
[[Element][Value]]
[[`empty()`][`false`]]
[[`size()`][`distance(first,last)`]]
[[`str()`][`basic_string<charT>(first,last)`]]
[[`flags()`][['f]]]
[[`mark_count()`][The number of marked sub-expressions within the expression.]]
]
[#boost_regex.basic_regex.opeq1]
basic_regex& operator=(const basic_regex& e);
[*Effects]: Returns the result of `assign(e.str(), e.flags())`.
[#boost_regex.basic_regex.opeq2]
basic_regex& operator=(const charT* ptr);
[*Requires]: /p/ shall not be a null pointer.
[*Effects]: Returns the result of `assign(ptr)`.
[#boost_regex.basic_regex.opeq3]
template <class ST, class SA>
basic_regex& operator=(const basic_string<charT, ST, SA>& p);
[*Effects]: Returns the result of `assign(p)`.
[#boost_regex.basic_regex.subexpression]
std::pair<const_iterator, const_iterator> subexpression(size_type n) const;
[*Effects]: Returns a pair of iterators denoting the location of
marked subexpression /n/ within the original regular expression string.
The returned iterators are relative to `begin()` and `end()`.
[*Requires]: The expression must have been compiled with the
[syntax_option_type] save_subexpression_location set. Argument
/n/ must be in within the range `0 <= n < mark_count()`.
[#boost_regex.basic_regex.begin]
const_iterator begin() const;
[*Effects]: Returns a starting iterator to a sequence of characters representing
the regular expression.
[#boost_regex.basic_regex.end]
const_iterator end() const;
[*Effects]: Returns termination iterator to a sequence of characters representing
the regular expression.
[#boost_regex.basic_regex.size]
size_type size() const;
[*Effects]: Returns the length of the sequence of characters representing the regular expression.
[#boost_regex.basic_regex.max_size]
size_type max_size() const;
[*Effects]: Returns the maximum length of the sequence of characters representing
the regular expression.
[#boost_regex.basic_regex.empty]
bool empty() const;
[*Effects]: Returns true if the object does not contain a valid regular expression,
otherwise false.
[#boost_regex.basic_regex.mark_count]
size_type mark_count() const;
[*Effects]: Returns the number of marked sub-expressions within the regular expression.
[#boost_regex.basic_regex.assign1]
basic_regex& assign(const basic_regex& that);
[*Effects]: Returns [link boost_regex.basic_regex.assign4 `assign(that.str(), that.flags())`].
[#boost_regex.basic_regex.assign2]
basic_regex& assign(const charT* ptr, flag_type f = regex_constants::normal);
[*Effects]: Returns [link boost_regex.basic_regex.assign4 `assign(string_type(ptr), f)`].
[#boost_regex.basic_regex.assign3]
basic_regex& assign(const charT* ptr, unsigned int len, flag_type f);
[*Effects]: Returns [link boost_regex.basic_regex.assign4 `assign(string_type(ptr, len), f)`].
[#boost_regex.basic_regex.assign4]
template <class string_traits, class A>
basic_regex& assign(const basic_string<charT, string_traits, A>& s,
flag_type f = regex_constants::normal);
[*Throws]: [bad_expression] if /s/ is not a valid regular expression,
unless the flag `no_except` is set in /f/.
[*Returns]: *this.
[*Effects]: Assigns the regular expression contained in the string /s/,
interpreted according the [link boost_regex.ref.syntax_option_type option flags]
specified in /f/.
[table Postconditions for basic_regex::assign
[[Element][Value]]
[[`empty()`][`false`]]
[[`size()`][`s.size()`]]
[[`str()`][['s]]]
[[`flags()`][['f]]]
[[`mark_count()`][The number of marked sub-expressions within the expression.]]
]
[#boost_regex.basic_regex.assign5]
template <class InputIterator>
basic_regex& assign(InputIterator first, InputIterator last,
flag_type f = regex_constants::normal);
[*Requires]: The type `InputIterator` corresponds to the
[@http://input_iterator Input Iterator requirements
(24.1.1)].
[*Effects]: Returns [link boost_regex.basic_regex.assign4 `assign(string_type(first, last), f)`].
[#boost_regex.basic_regex.flags]
flag_type flags() const;
[*Effects]: Returns a copy of the [link boost_regex.ref.syntax_option_type
regular expression syntax flags] that were passed to the object's constructor,
or the last call to `assign`.
[#boost_regex.basic_regex.status]
int status() const;
[*Effects]: Returns zero if the expression contains a valid regular expression,
otherwise an error code. This member function is retained for use in
environments that cannot use exception handling.
[#boost_regex.basic_regex.str]
basic_string<charT> str() const;
[*Effects]: Returns a copy of the character sequence passed to the object's constructor,
or the last call to assign.
[#boost_regex.basic_regex.compare]
int compare(basic_regex& e)const;
[*Effects]: If `flags() == e.flags()` then returns `str().compare(e.str())`,
otherwise returns `flags() - e.flags()`.
[#boost_regex.basic_regex.imbue]
locale_type imbue(locale_type l);
[*Effects]: Returns the result of `traits_inst.imbue(l)` where `traits_inst` is
a (default initialized) instance of the template parameter `traits` stored
within the object. Calls to `imbue` invalidate any currently contained
regular expression.
[*Postcondition]: `empty() == true`.
[#boost_regex.basic_regex.getloc]
locale_type getloc() const;
[*Effects]: Returns the result of `traits_inst.getloc()` where `traits_inst` is
a (default initialized) instance of the template parameter traits stored
within the object.
[#boost_regex.basic_regex.swap]
void swap(basic_regex& e) throw();
[*Effects]: Swaps the contents of the two regular expressions.
[*Postcondition]: `*this` contains the regular expression that was in /e/, /e/ contains
the regular expression that was in `*this`.
[*Complexity]: constant time.
[note Comparisons between [basic_regex] objects are provided on an
experimental basis: please note that these are not present in the [tr1],
so use with care if you are writing code that may need to be ported
to other implementations of [basic_regex].]
[#boost_regex.basic_regex.op_eq]
template <class charT, class traits>
bool operator == (const basic_regex<charT, traits>& lhs,
const basic_regex<charT, traits>& rhs);
[*Effects]: Returns `lhs.compare(rhs) == 0`.
[#boost_regex.basic_regex.op_ne]
template <class charT, class traits>
bool operator != (const basic_regex<charT, traits>& lhs,
const basic_regex<charT, traits>& rhs);
[*Effects]: Returns `lhs.compare(rhs) != 0`.
[#boost_regex.basic_regex.op_lt]
template <class charT, class traits>
bool operator < (const basic_regex<charT, traits>& lhs,
const basic_regex<charT, traits>& rhs);
[*Effects]: Returns `lhs.compare(rhs) < 0`.
[#boost_regex.basic_regex.op_le]
template <class charT, class traits>
bool operator <= (const basic_regex<charT, traits>& lhs,
const basic_regex<charT, traits>& rhs);
[*Effects]: Returns `lhs.compare(rhs) <= 0`.
[#boost_regex.basic_regex.op_ge]
template <class charT, class traits>
bool operator >= (const basic_regex<charT, traits>& lhs,
const basic_regex<charT, traits>& rhs);
[*Effects]: Returns `lhs.compare(rhs) >= 0`.
[#boost_regex.basic_regex.op_gt]
template <class charT, class traits>
bool operator > (const basic_regex<charT, traits>& lhs,
const basic_regex<charT, traits>& rhs);
[*Effects]: Returns `lhs.compare(rhs) > 0`.
[note The basic_regex stream inserter is provided on an experimental basis,
and outputs the textual representation of the expression to the stream.]
[#boost_regex.basic_regex.op_stream]
template <class charT, class io_traits, class re_traits>
basic_ostream<charT, io_traits>&
operator << (basic_ostream<charT, io_traits>& os
const basic_regex<charT, re_traits>& e);
[*Effects]: Returns `(os << e.str())`.
[#boost_regex.basic_regex.op_swap]
template <class charT, class traits>
void swap(basic_regex<charT, traits>& lhs,
basic_regex<charT, traits>& rhs);
[*Effects]: calls `lhs.swap(rhs)`.
[endsect]

200
doc/captures.qbk Normal file
View File

@ -0,0 +1,200 @@
[/
Copyright 2006-2007 John Maddock.
Distributed under the Boost Software License, Version 1.0.
(See accompanying file LICENSE_1_0.txt or copy at
http://www.boost.org/LICENSE_1_0.txt).
]
[section:captures Understanding Marked Sub-Expressions and Captures]
Captures are the iterator ranges that are "captured" by marked
sub-expressions as a regular expression gets matched. Each marked
sub-expression can result in more than one capture, if it is matched
more than once. This document explains how captures and marked
sub-expressions in Boost.Regex are represented and accessed.
[h4 Marked sub-expressions]
Every time a Perl regular expression contains a parenthesis group `()`, it
spits out an extra field, known as a marked sub-expression,
for example the expression:
[pre (\w+)\W+(\w+)]
Has two marked sub-expressions (known as $1 and $2 respectively), in
addition the complete match is known as $&, everything before the
first match as $\`, and everything after the match as $'. So
if the above expression is searched for within `"@abc def--"`, then we obtain:
[table
[[Sub-expression][Text found]]
[[$\`]["@"]]
[[$&]["abc def"]]
[[$1]["abc"]]
[[$2]["def"]]
[[$']["--"]]
]
In Boost.Regex all these are accessible via the [match_results] class that
gets filled in when calling one of the regular expression matching algorithms
([regex_search], [regex_match], or [regex_iterator]). So given:
boost::match_results<IteratorType> m;
The Perl and Boost.Regex equivalents are as follows:
[table
[[Perl][Boost.Regex]]
[[$\`][`m.prefix()`]]
[[$&][`m[0]`]]
[[$n][`m[n]`]]
[[$\'][`m.suffix()`]]
]
In Boost.Regex each sub-expression match is represented by a [sub_match] object,
this is basically just a pair of iterators denoting the start and end
position of the sub-expression match, but there are some additional
operators provided so that objects of type [sub_match] behave a lot like a
`std::basic_string`: for example they are implicitly convertible to a
`basic_string`, they can be compared to a string, added to a string, or
streamed out to an output stream.
[h4 Unmatched Sub-Expressions]
When a regular expression match is found there is no need for all of the
marked sub-expressions to have participated in the match, for example the expression:
[pre (abc)|(def)]
can match either $1 or $2, but never both at the same time. In Boost.Regex
you can determine which sub-expressions matched by accessing the
`sub_match::matched` data member.
[h4 Repeated Captures]
When a marked sub-expression is repeated, then the sub-expression gets
"captured" multiple times, however normally only the final capture is available,
for example if
[pre (?:(\w+)\W+)+]
is matched against
[pre one fine day]
Then $1 will contain the string "day", and all the previous captures will have
been forgotten.
However, Boost.Regex has an experimental feature that allows all the capture
information to be retained - this is accessed either via the
`match_results::captures` member function or the `sub_match::captures` member
function. These functions return a container that contains a sequence of all
the captures obtained during the regular expression matching. The following
example program shows how this information may be used:
#include <boost/regex.hpp>
#include <iostream>
void print_captures(const std::string& regx, const std::string& text)
{
boost::regex e(regx);
boost::smatch what;
std::cout << "Expression: \"" << regx << "\"\n";
std::cout << "Text: \"" << text << "\"\n";
if(boost::regex_match(text, what, e, boost::match_extra))
{
unsigned i, j;
std::cout << "** Match found **\n Sub-Expressions:\n";
for(i = 0; i < what.size(); ++i)
std::cout << " $" << i << " = \"" << what[i] << "\"\n";
std::cout << " Captures:\n";
for(i = 0; i < what.size(); ++i)
{
std::cout << " $" << i << " = {";
for(j = 0; j < what.captures(i).size(); ++j)
{
if(j)
std::cout << ", ";
else
std::cout << " ";
std::cout << "\"" << what.captures(i)[j] << "\"";
}
std::cout << " }\n";
}
}
else
{
std::cout << "** No Match found **\n";
}
}
int main(int , char* [])
{
print_captures("(([[:lower:]]+)|([[:upper:]]+))+", "aBBcccDDDDDeeeeeeee");
print_captures("(.*)bar|(.*)bah", "abcbar");
print_captures("(.*)bar|(.*)bah", "abcbah");
print_captures("^(?:(\\w+)|(?>\\W+))*$",
"now is the time for all good men to come to the aid of the party");
return 0;
}
Which produces the following output:
[pre
Expression: "((\[\[:lower:\]\]+)|(\[\[:upper:\]\]+))+"
Text: "aBBcccDDDDDeeeeeeee"
'''**''' Match found '''**'''
Sub-Expressions:
$0 = "aBBcccDDDDDeeeeeeee"
$1 = "eeeeeeee"
$2 = "eeeeeeee"
$3 = "DDDDD"
Captures:
$0 = { "aBBcccDDDDDeeeeeeee" }
$1 = { "a", "BB", "ccc", "DDDDD", "eeeeeeee" }
$2 = { "a", "ccc", "eeeeeeee" }
$3 = { "BB", "DDDDD" }
Expression: "(.'''*''')bar|(.'''*''')bah"
Text: "abcbar"
'''**''' Match found '''**'''
Sub-Expressions:
$0 = "abcbar"
$1 = "abc"
$2 = ""
Captures:
$0 = { "abcbar" }
$1 = { "abc" }
$2 = { }
Expression: "(.'''*''')bar|(.'''*''')bah"
Text: "abcbah"
'''**''' Match found '''**'''
Sub-Expressions:
$0 = "abcbah"
$1 = ""
$2 = "abc"
Captures:
$0 = { "abcbah" }
$1 = { }
$2 = { "abc" }
Expression: "^(?:(\w+)|(?>\W+))'''*$'''"
Text: "now is the time for all good men to come to the aid of the party"
'''**''' Match found '''**'''
Sub-Expressions:
$0 = "now is the time for all good men to come to the aid of the party"
$1 = "party"
Captures:
$0 = { "now is the time for all good men to come to the aid of the party" }
$1 = { "now", "is", "the", "time", "for", "all", "good", "men", "to",
"come", "to", "the", "aid", "of", "the", "party" }
]
Unfortunately enabling this feature has an impact on performance
(even if you don't use it), and a much bigger impact if you do use it,
therefore to use this feature you need to:
* Define BOOST_REGEX_MATCH_EXTRA for all translation units including the library source (the best way to do this is to uncomment this define in boost/regex/user.hpp and then rebuild everything.
* Pass the match_extra flag to the particular algorithms where you actually need the captures information (regex_search, regex_match, or regex_iterator).
[endsect]

View File

@ -0,0 +1,92 @@
[/
Copyright 2006-2007 John Maddock.
Distributed under the Boost Software License, Version 1.0.
(See accompanying file LICENSE_1_0.txt or copy at
http://www.boost.org/LICENSE_1_0.txt).
]
[section:character_classes Character Class Names]
[section:std_char_classes Character Classes that are Always Supported]
The following character class names are always supported by Boost.Regex:
[table
[[Name] [POSIX-standard name] [Description]]
[[alnum] [Yes] [Any alpha-numeric character.]]
[[alpha] [Yes] [Any alphabetic character.]]
[[blank] [Yes] [Any whitespace character that is not a line separator.]]
[[cntrl] [Yes] [Any control character.]]
[[d] [No] [Any decimal digit]]
[[digit] [Yes] [Any decimal digit.]]
[[graph] [Yes] [Any graphical character.]]
[[l] [No] [Any lower case character.]]
[[lower] [Yes] [Any lower case character.]]
[[print] [Yes] [Any printable character.]]
[[punct] [Yes] [Any punctuation character.]]
[[s] [No] [Any whitespace character.]]
[[space] [Yes] [Any whitespace character.]]
[[unicode] [No] [Any extended character whose code point is above 255 in value.]]
[[u] [No] [Any upper case character.]]
[[upper] [Yes] [Any upper case character.]]
[[w] [No] [Any word character (alphanumeric characters plus the underscore).]]
[[word] [No] [Any word character (alphanumeric characters plus the underscore).]]
[[xdigit] [Yes] [Any hexadecimal digit character.]]
]
[endsect]
[section:optional_char_class_names Character classes that are supported by Unicode Regular Expressions]
The following character classes are only supported by Unicode Regular Expressions:
that is those that use the `u32regex` type. The names used are the same as
those from Chapter 4 of the Unicode standard.
[table
[[Short Name] [Long Name]]
[[ ] [ASCII]]
[[ ] [Any]]
[[ ] [Assigned]]
[[C*] [Other]]
[[Cc] [Control]]
[[Cf] [Format]]
[[Cn] [Not Assigned]]
[[Co] [Private Use]]
[[Cs] [Surrogate]]
[[L*] [Letter]]
[[Ll] [Lowercase Letter]]
[[Lm] [Modifier Letter]]
[[Lo] [Other Letter]]
[[Lt] [Titlecase]]
[[Lu] [Uppercase Letter]]
[[M*] [Mark]]
[[Mc] [Spacing Combining Mark]]
[[Me] [Enclosing Mark]]
[[Mn] [Non-Spacing Mark]]
[[N*] [Number]]
[[Nd] [Decimal Digit Number]]
[[Nl] [Letter Number]]
[[No] [Other Number]]
[[P*] [Punctuation]]
[[Pc] [Connector Punctuation]]
[[Pd] [Dash Punctuation]]
[[Pe] [Close Punctuation]]
[[Pf] [Final Punctuation]]
[[Pi] [Initial Punctuation]]
[[Po] [Other Punctuation]]
[[Ps] [Open Punctuation]]
[[S*] [Symbol]]
[[Sc] [Currency Symbol]]
[[Sk] [Modifier Symbol]]
[[Sm] [Math Symbol]]
[[So] [Other Symbol]]
[[Z*] [Separator]]
[[Zl] [Line Separator]]
[[Zp] [Paragraph Separator]]
[[Zs] [Space Separator]]
]
[endsect]
[endsect]

128
doc/collating_names.qbk Normal file
View File

@ -0,0 +1,128 @@
[/
Copyright 2006-2007 John Maddock.
Distributed under the Boost Software License, Version 1.0.
(See accompanying file LICENSE_1_0.txt or copy at
http://www.boost.org/LICENSE_1_0.txt).
]
[section:collating_names Collating Names]
[section:digraphs Digraphs]
The following are treated as valid digraphs when used as a collating name:
"ae", "Ae", "AE", "ch", "Ch", "CH", "ll", "Ll", "LL", "ss", "Ss", "SS", "nj", "Nj", "NJ", "dz", "Dz", "DZ", "lj", "Lj", "LJ".
So for example the expression:
[pre \[\[.ae.\]-c\] ]
will match any character that collates between the digraph "ae" and the character "c".
[endsect]
[section:posix_symbolic_names POSIX Symbolic Names]
The following symbolic names are recognised as valid collating element names,
in addition to any single character, this allows you to write for example:
[pre \[\[.left-square-bracket.\]\[.right-square-bracket.\]\]]
if you wanted to match either "\[" or "\]".
[table
[[Name][Character]]
[[NUL] [\\x00]]
[[SOH] [\\x01]]
[[STX] [\\x02]]
[[ETX] [\\x03]]
[[EOT] [\\x04]]
[[ENQ] [\\x05]]
[[ACK] [\\x06]]
[[alert] [\\x07]]
[[backspace] [\\x08]]
[[tab] [\\t]]
[[newline] [\\n]]
[[vertical-tab] [\\v]]
[[form-feed] [\\f]]
[[carriage-return] [\\r]]
[[SO] [\\xE]]
[[SI] [\\xF]]
[[DLE] [\\x10]]
[[DC1] [\\x11]]
[[DC2] [\\x12]]
[[DC3] [\\x13]]
[[DC4] [\\x14]]
[[NAK] [\\x15]]
[[SYN] [\\x16]]
[[ETB] [\\x17]]
[[CAN] [\\x18]]
[[EM] [\\x19]]
[[SUB] [\\x1A]]
[[ESC] [\\x1B]]
[[IS4] [\\x1C]]
[[IS3] [\\x1D]]
[[IS2] [\\x1E]]
[[IS1] [\\x1F]]
[[space] [\\x20]]
[[exclamation-mark] [!]]
[[quotation-mark] ["]]
[[number-sign] [#]]
[[dollar-sign] [$]]
[[percent-sign] [%]]
[[ampersand] [&]]
[[apostrophe] [\']]
[[left-parenthesis] [(]]
[[right-parenthesis] [)]]
[[asterisk] [\*]]
[[plus-sign] [+]]
[[comma] [,]]
[[hyphen] [-]]
[[period] [.]]
[[slash] [ / ]]
[[zero] [0]]
[[one] [1]]
[[two] [2]]
[[three] [3]]
[[four] [4]]
[[five] [5]]
[[six] [6]]
[[seven] [7]]
[[eight] [8]]
[[nine] [9]]
[[colon] [\:]]
[[semicolon] [;]]
[[less-than-sign] [<]]
[[equals-sign] [=]]
[[greater-than-sign] [>]]
[[question-mark] [?]]
[[commercial-at] [@]]
[[left-square-bracket] [\[]]
[[backslash][\\]]
[[right-square-bracket][\]]]
[[circumflex][~]]
[[underscore][_]]
[[grave-accent][`]]
[[left-curly-bracket][{]]
[[vertical-line][|]]
[[right-curly-bracket][}]]
[[tilde][~]]
[[DEL][\\x7F]]
]
[endsect]
[section:named_unicode Named Unicode Characters]
When using [link boost_regex.unicode Unicode aware regular expressions] (with the `u32regex` type), all
the normal symbolic names for Unicode characters (those given in Unidata.txt)
are recognised. So for example:
[pre \[\[.CYRILLIC CAPITAL LETTER I.\]\] ]
would match the Unicode character 0x0418.
[endsect]
[endsect]

131
doc/concepts.qbk Normal file
View File

@ -0,0 +1,131 @@
[/
Copyright 2006-2007 John Maddock.
Distributed under the Boost Software License, Version 1.0.
(See accompanying file LICENSE_1_0.txt or copy at
http://www.boost.org/LICENSE_1_0.txt).
]
[section:concepts Concepts]
[section:charT_concept charT Requirements]
Type `charT` used a template argument to class template [basic_regex],
must have a trivial default constructor, copy constructor,
assignment operator, and destructor. In addition the following requirements
must be met for objects; /c/ of type `charT`, /c1/ and /c2/ of type `charT const`,
and /i/ of type `int`:
[table
[[Expression] [Return type] [Assertion / Note / Pre- / Post-condition]]
[[charT c] [charT] [Default constructor (must be trivial).]]
[[charT c(c1)] [charT] [Copy constructor (must be trivial).]]
[[c1 = c2] [charT] [Assignment operator (must be trivial).]]
[[c1 == c2] [bool] [true if c1 has the same value as c2.]]
[[c1 != c2] [bool] [true if c1 and c2 are not equal.]]
[[c1 < c2] [bool] [true if the value of c1 is less than c2.]]
[[c1 > c2] [bool] [true if the value of c1 is greater than c2.]]
[[c1 <= c2] [bool] [true if c1 is less than or equal to c2.]]
[[c1 >= c2] [bool] [true if c1 is greater than or equal to c2.]]
[[intmax_t i = c1] [int ] [charT must be convertible to an integral type.
Note: type charT is not required to support this operation, if the traits class used supports the full Boost-specific interface, rather than the minimal standardised-interface (see traits class requirements below).]]
[[charT c(i);] [charT] [charT must be constructable from an integral type.]]
]
[endsect]
[section:traits_concept Traits Class Requirements]
There are two sets of requirements for the `traits` template argument to
[basic_regex]: a minimal interface (which is part of the regex standardization proposal),
and an optional Boost-specific enhanced interface.
[h4 Minimal requirements.]
In the following table `X` denotes a traits class defining types and functions for
the character container type `charT`; /u/ is an object of type `X`; /v/ is
an object of type `const X`; /p/ is a value of type `const charT*`;
/I1/ and /I2/ are Input Iterators; /c/ is a value of type `const charT`;
/s/ is an object of type `X::string_type`; /cs/ is an object of type
`const X::string_type`; /b/ is a value of type `bool`; /I/ is a value of
type `int`; /F1/ and /F2/ are values of type `const charT*`; and /loc/ is
an object of type `X::locale_type`.
[table
[[Expression][Return type][Assertion / Note Pre / Post condition]]
[[X::char_type][charT][The character container type used in the implementation of class template basic_regex.]]
[[X::size_type][][An unsigned integer type, capable of holding the length of a null-terminated string of charT's.]]
[[X::string_type][std::basic_string<charT> or std::vector<charT>][]]
[[X::locale_type][Implementation defined][A copy constructible type that represents the locale used by the traits class.]]
[[X::char_class_type]
[Implementation defined]
[A bitmask type representing a particular character classification. Multiple values of this type can be bitwise-or'ed together to obtain a new valid value.]]
[[X::length(p)][X::size_type][Yields the smallest i such that p\[i\] == 0. Complexity is linear in i.]]
[[v.translate(c)]
[X::char_type]
[Returns a character such that for any character d that is to be considered equivalent to c then v.translate(c) == v.translate(d).]]
[[v.translate_nocase(c)]
[X::char_type]
[For all characters C that are to be considered equivalent to c when comparisons are to be performed without regard to case, then v.translate_nocase(c) == v.translate_nocase(C).]]
[[v.transform(F1, F2)]
[X::string_type]
[Returns a sort key for the character sequence designated by the iterator range \[F1, F2) such that if
the character sequence \[G1, G2) sorts before the character sequence \[H1, H2) then
v.transform(G1, G2) < v.transform(H1, H2). ]]
[[v.transform_primary(F1, F2)]
[X::string_type]
[Returns a sort key for the character sequence designated by the iterator range \[F1, F2) such that if the
character sequence \[G1, G2) sorts before the character sequence \[H1, H2) when character case is not considered
then v.transform_primary(G1, G2) < v.transform_primary(H1, H2).]]
[[v.lookup_classname(F1, F2)]
[X::char_class_type]
[Converts the character sequence designated by the iterator range \[F1,F2) into a bitmask type that can subsequently
be passed to isctype. Values returned from lookup_classname can be safely bitwise or'ed together. Returns 0 if the
character sequence is not the name of a character class recognized by X. The value returned shall be independent
of the case of the characters in the sequence.]]
[[v.lookup_collatename(F1, F2)]
[X::string_type]
[Returns a sequence of characters that represents the collating element consisting of the character sequence designated
by the iterator range \[F1, F2). Returns an empty string if the character sequence is not a valid collating element.]]
[[v.isctype(c, v.lookup_classname (F1, F2))][bool][Returns true if character c is a member of the character class designated by the iterator range \[F1, F2), false otherwise.]]
[[v.value(c, I)]
[int]
[Returns the value represented by the digit c in base I if the character c is a valid digit in base I; otherwise returns -1. \[Note: the value of I will only be 8, 10, or 16. -end note\]]]
[[u.imbue(loc)][X::locale_type][Imbues u with the locale loc, returns the previous locale used by u if any. ]]
[[v.getloc()][X::locale_type][Returns the current locale used by v if any. ]]
]
[h4 Additional Optional Requirements]
The following additional requirements are strictly optional,
however in order for [basic_regex] to take advantage of these additional
interfaces, all of the following requirements must be met; [basic_regex]
will detect the presence or absence of the member `boost_extensions_tag` and
configure itself appropriately.
[table
[[Expression][Result][Assertion / Note Pre / Post condition]]
[[X::boost_extensions_tag][An unspecified type.][When present, all of the extensions listed in this table must be present.]]
[[v.syntax_type(c)][regex_constants::syntax_type][Returns a symbolic value of type regex_constants::syntax_type that signifies the meaning of character c within the regular expression grammar.]]
[[v.escape_syntax_type(c)][regex_constants::escape_syntax_type][Returns a symbolic value of type regex_constants::escape_syntax_type, that signifies the meaning of character c within the regular expression grammar, when c has been preceded by an escape character. Precondition: if b is the character preceding c in the expression being parsed then: `v.syntax_type(b) == syntax_escape`]]
[[v.translate(c, b)][X::char_type][Returns a character d such that: for any character d that is to be considered equivalent to c then `v.translate(c,false)==v.translate(d,false)`. Likewise for all characters C that are to be considered equivalent to c when comparisons are to be performed without regard to case, then `v.translate(c,true)==v.translate(C,true)`.]]
[[v.toi(I1, I2, i)][An integer type capable of holding either a charT or an int.][Behaves as follows: if `p == q` or if `*p` is not a digit character then returns -1. Otherwise performs formatted numeric input on the sequence \[p,q) and returns the result as an int. Postcondition: either p == q or *p is a non-digit character.]]
[[v.error_string(I)][std::string][Returns a human readable error string for the error condition i, where i is one of the values enumerated by type regex_constants::error_type. If the value /I/ is not recognized then returns the string "Unknown error" or a localized equivalent.]]
[[v.tolower(c)][X::char_type][Converts c to lower case, used for Perl-style \l and \L formatting operations.]]
[[v.toupper(c)][X::char_type][Converts c to upper case, used for Perl-style \u and \U formatting operations.]]
]
[endsect]
[section:iterator_concepts Iterator Requirements]
The regular expression algorithms (and iterators) take all require a
Bidirectional-Iterator.
[endsect]
[endsect]

71
doc/configuration.qbk Normal file
View File

@ -0,0 +1,71 @@
[/
Copyright 2006-2007 John Maddock.
Distributed under the Boost Software License, Version 1.0.
(See accompanying file LICENSE_1_0.txt or copy at
http://www.boost.org/LICENSE_1_0.txt).
]
[section:configuration Configuration]
[section:compiler Compiler Setup]
You shouldn't need to do anything special to configure Boost.Regex for use
with your compiler - the [@../../../config/index.html Boost.Config subsystem] should already take care of it,
if you do have problems (or you are using a particularly obscure compiler
or platform) then [@../../../config/index.html Boost.Config] has a configure script that you can run.
[endsect]
[section:standalone Use in Standalone Mode (without the rest of Boost)]
This library may now be used in "standalone" mode without the rest of the Boost C++ libraries,
in order to do this you must either:
* Have a C++17 compiler that supports `__has_include`, in this case if `<boost/config.hpp>` is *not* present
then the library will automoatically enter standalone mode. Or:
* Define BOOST_REGEX_STANDALONE when building.
The main difference between the 2 modes, is that when Boost.Config is present the library will automatically
configure itself around various compiler defects. In particular in order to use the library with exception support
turned off, you will either need a copy of Boost.Config in your include path, or else manually define BOOST_NO_EXCEPTIONS
when building.
[endsect]
[section:locale Locale and traits class selection]
The following macros (see [@../../../../boost/regex/user.hpp user.hpp]) control how Boost.Regex interacts with
the user's locale:
[table
[[macro][description]]
[[BOOST_REGEX_USE_C_LOCALE][Forces Boost.Regex to use the global C locale in its traits class support: this is now deprecated in favour of the C++ locale.]]
[[BOOST_REGEX_USE_CPP_LOCALE][Forces Boost.Regex to use std::locale in it's default traits class, regular expressions can then be imbued with an instance specific locale. This is the default behaviour on non-Windows platforms.]]
[[BOOST_REGEX_NO_W32][Tells Boost.Regex not to use any Win32 API's even when available (implies BOOST_REGEX_USE_CPP_LOCALE unless BOOST_REGEX_USE_C_LOCALE is set).]]
]
[endsect]
[section:tuning Algorithm Tuning]
[table
[[macro][description]]
[[BOOST_REGEX_BLOCKSIZE][Boost.Regex uses largish blocks of memory to act as a stack for the state machine, the larger the block size then the fewer allocations that will take place. This defaults to 4096 bytes, which is large enough to match the vast majority of regular expressions without further allocations, however, you can choose smaller or larger values depending upon your platforms characteristics.]]
[[BOOST_REGEX_MAX_BLOCKS][Tells Boost.Regex how many blocks of size BOOST_REGEX_BLOCKSIZE it is permitted to use. If this value is exceeded then Boost.Regex will stop trying to find a match and throw a std::runtime_error. Defaults to 1024, don't forget to tweak this value if you alter BOOST_REGEX_BLOCKSIZE by much.]]
[[BOOST_REGEX_MAX_CACHE_BLOCKS][Tells Boost.Regex how many memory blocks to store in
it's internal cache - memory blocks are taken from this cache rather than by calling
::operator new. Generally speaking this can be an order of magnitude faster than
calling ::opertator new each time a memory block is required, but has the
downside that Boost.Regex can end up caching a large chunk of memory (by default
up to 16 blocks each of BOOST_REGEX_BLOCKSIZE size). If memory is tight then try
defining this to 0 (disables all caching), or if that is too slow, then a value of
1 or 2, may be sufficient. On the other hand, on large multi-processor,
multi-threaded systems, you may find that a higher value is in order.]]
]
[endsect]
[endsect]

63
doc/error_type.qbk Normal file
View File

@ -0,0 +1,63 @@
[/
Copyright 2006-2007 John Maddock.
Distributed under the Boost Software License, Version 1.0.
(See accompanying file LICENSE_1_0.txt or copy at
http://www.boost.org/LICENSE_1_0.txt).
]
[section:error_type error_type]
[h4 Synopsis]
Type error type represents the different types of errors that can be raised
by the library when parsing a regular expression.
namespace boost{ namespace regex_constants{
typedef implementation-specific-type error_type;
static const error_type error_collate;
static const error_type error_ctype;
static const error_type error_escape;
static const error_type error_backref;
static const error_type error_brack;
static const error_type error_paren;
static const error_type error_brace;
static const error_type error_badbrace;
static const error_type error_range;
static const error_type error_space;
static const error_type error_badrepeat;
static const error_type error_complexity;
static const error_type error_stack;
static const error_type error_bad_pattern;
} // namespace regex_constants
} // namespace boost
[h4 Description]
The type `error_type` is an implementation-specific enumeration type that may
take one of the following values:
[table
[[Constant][Meaning]]
[[error_collate][An invalid collating element was specified in a \[\[.name.\]\] block.]]
[[error_ctype][An invalid character class name was specified in a \[\[:name:\]\] block.]]
[[error_escape][An invalid or trailing escape was encountered.]]
[[error_backref][A back-reference to a non-existant marked sub-expression was encountered.]]
[[error_brack][An invalid character set \[...\] was encountered.]]
[[error_paren][Mismatched '(' and ')'.]]
[[error_brace][Mismatched '{' and '}'.]]
[[error_badbrace][Invalid contents of a {...} block.]]
[[error_range][A character range was invalid, for example \[d-a\].]]
[[error_space][Out of memory.]]
[[error_badrepeat][An attempt to repeat something that can not be repeated - for example a*+]]
[[error_complexity][The expression became too complex to handle.]]
[[error_stack][Out of program stack space.]]
[[error_bad_pattern][Other unspecified errors.]]
]
[endsect]

128
doc/examples.qbk Normal file
View File

@ -0,0 +1,128 @@
[/
Copyright 2006-2007 John Maddock.
Distributed under the Boost Software License, Version 1.0.
(See accompanying file LICENSE_1_0.txt or copy at
http://www.boost.org/LICENSE_1_0.txt).
]
[section:examples Test and Example Programs]
[h4 Test Programs]
[*regress:]
A regression test application that gives the matching/searching algorithms a
full workout. The presence of this program is your guarantee that the
library will behave as claimed - at least as far as those items tested
are concerned - if anyone spots anything that isn't being tested I'd be
glad to hear about it.
Files:
* [@../../test/regress/main.cpp main.cpp]
* [@../../test/regress/basic_tests.cpp basic_tests.cpp]
* [@../../test/regress/test_alt.cpp test_alt.cpp]
* [@../../test/regress/test_anchors.cpp test_anchors.cpp]
* [@../../test/regress/test_asserts.cpp test_asserts.cpp]
* [@../../test/regress/test_backrefs.cpp test_backrefs.cpp]
* [@../../test/regress/test_deprecated.cpp test_deprecated.cpp]
* [@../../test/regress/test_emacs.cpp test_emacs.cpp]
* [@../../test/regress/test_escapes.cpp test_escapes.cpp]
* [@../../test/regress/test_grep.cpp test_grep.cpp]
* [@../../test/regress/test_icu.cpp test_icu.cpp]
* [@../../test/regress/test_locale.cpp test_locale.cpp]
* [@../../test/regress/test_mfc.cpp test_mfc.cpp]
* [@../../test/regress/test_non_greedy_repeats.cpp test_non_greedy_repeats.cpp]
* [@../../test/regress/test_operators.cpp test_operators.cpp]
* [@../../test/regress/test_overloads.cpp test_overloads.cpp]
* [@../../test/regress/test_perl_ex.cpp test_perl_ex.cpp]
* [@../../test/regress/test_replace.cpp test_replace.cpp]
* [@../../test/regress/test_sets.cpp test_sets.cpp]
* [@../../test/regress/test_simple_repeats.cpp test_simple_repeats.cpp]
* [@../../test/regress/test_tricky_cases.cpp test_tricky_cases.cpp]
* [@../../test/regress/test_unicode.cpp test_unicode.cpp]
[*bad_expression_test:]
Verifies that "bad" regular expressions don't cause the matcher to go into
infinite loops, but to throw an exception instead.
Files: [@../../test/pathology/bad_expression_test.cpp bad_expression_test.cpp].
[*recursion_test:]
Verifies that the matcher can't overrun the stack (no matter what the expression).
Files: [@../../test/pathology/recursion_test.cpp recursion_test.cpp].
[*concepts:]
Verifies that the library meets all documented concepts (a compile only test).
Files: [@../../test/concepts/concept_check.cpp concept_check.cpp].
[*captures_test:]
Test code for captures.
Files: [@../../test/captures/captures_test.cpp captures_test.cpp].
[h4 Example programs]
[*grep]
A simple grep implementation, run with the -h command line option to find out its usage.
Files: [@../../example/grep/grep.cpp grep.cpp]
[*timer.exe]
A simple interactive expression matching application, the results of all
matches are timed, allowing the programmer to optimize their regular expressions
where performance is critical.
Files: [@../../example/timer/regex_timer.cpp regex_timer.cpp].
[h4 Code snippets]
The snippets examples contain the code examples used in the documentation:
[@../../example/snippets/captures_example.cpp captures_example.cpp]: Demonstrates the use of captures.
[@../../example/snippets/credit_card_example.cpp credit_card_example.cpp]: Credit card number formatting code.
[@../../example/snippets/partial_regex_grep.cpp partial_regex_grep.cpp]: Search example using partial matches.
[@../../example/snippets/partial_regex_match.cpp partial_regex_match.cpp]: regex_match example using partial matches.
[@../../example/snippets/regex_iterator_example.cpp regex_iterator_example.cpp]: Iterating through a series of matches.
[@../../example/snippets/regex_match_example.cpp regex_match_example.cpp]: ftp based regex_match example.
[@../../example/snippets/regex_merge_example.cpp regex_merge_example.cpp]: regex_merge example: converts a C++ file to syntax highlighted HTML.
[@../../example/snippets/regex_replace_example.cpp regex_replace_example.cpp]: regex_replace example: converts a C++ file to syntax highlighted HTML
[@../../example/snippets/regex_search_example.cpp regex_search_example.cpp]: regex_search example: searches a cpp file for class definitions.
[@../../example/snippets/regex_token_iterator_eg_1.cpp regex_token_iterator_eg_1.cpp]: split a string into a series of tokens.
[@../../example/snippets/regex_token_iterator_eg_2.cpp regex_token_iterator_eg_2.cpp]: enumerate the linked URL's in a HTML file.
The following are deprecated:
[@../../example/snippets/regex_grep_example_1.cpp regex_grep_example_1.cpp]: regex_grep example 1: searches a cpp file for class definitions.
[@../../example/snippets/regex_grep_example_2.cpp regex_grep_example_2.cpp]: regex_grep example 2: searches a cpp file for class definitions, using a global callback function.
[@../../example/snippets/regex_grep_example_3.cpp regex_grep_example_3.cpp]: regex_grep example 2: searches a cpp file for class definitions, using a bound member function callback.
[@../../example/snippets/regex_grep_example_4.cpp regex_grep_example_4.cpp]: regex_grep example 2: searches a cpp file for class definitions, using a C++ Builder closure as a callback.
[@../../example/snippets/regex_split_example_1.cpp regex_split_example_1.cpp]: regex_split example: split a string into tokens.
[@../../example/snippets/regex_split_example_2.cpp regex_split_example_2.cpp] : regex_split example: spit out linked URL's.
[endsect]

98
doc/faq.qbk Normal file
View File

@ -0,0 +1,98 @@
[/
Copyright 2006-2007 John Maddock.
Distributed under the Boost Software License, Version 1.0.
(See accompanying file LICENSE_1_0.txt or copy at
http://www.boost.org/LICENSE_1_0.txt).
]
[section:faq FAQ]
[*Q.] I can't get regex++ to work with escape characters, what's going on?
[*A.] If you embed regular expressions in C++ code, then remember that escape
characters are processed twice: once by the C++ compiler, and once by the
Boost.Regex expression compiler, so to pass the regular expression \d+
to Boost.Regex, you need to embed "\\d+" in your code. Likewise to match a
literal backslash you will need to embed "\\\\" in your code.
[*Q.] No matter what I do regex_match always returns false, what's going on?
[*A.] The algorithm regex_match only succeeds if the expression matches *all*
of the text, if you want to *find* a sub-string within the text that matches
the expression then use regex_search instead.
[*Q.] Why does using parenthesis in a POSIX regular expression change the
result of a match?
[*A.] For POSIX (extended and basic) regular expressions, but not for perl regexes,
parentheses don't only mark; they determine what the best match is as well.
When the expression is compiled as a POSIX basic or extended regex then Boost.Regex
follows the POSIX standard leftmost longest rule for determining what matched.
So if there is more than one possible match after considering the whole expression,
it looks next at the first sub-expression and then the second sub-expression
and so on. So...
"'''(0*)([0-9]*)'''" against "00123" would produce
$1 = "00"
$2 = "123"
where as
"0*([0-9])*" against "00123" would produce
$1 = "00123"
If you think about it, had $1 only matched the "123", this would be "less good"
than the match "00123" which is both further to the left and longer. If you
want $1 to match only the "123" part, then you need to use something like:
"0*([1-9][0-9]*)"
as the expression.
[*Q.] Why don't character ranges work properly (POSIX mode only)?
[*A.] The POSIX standard specifies that character range expressions are
locale sensitive - so for example the expression [A-Z] will match any
collating element that collates between 'A' and 'Z'. That means that for
most locales other than "C" or "POSIX", [A-Z] would match the single
character 't' for example, which is not what most people expect - or
at least not what most people have come to expect from regular
expression engines. For this reason, the default behaviour of Boost.Regex
(perl mode) is to turn locale sensitive collation off by not setting the
`regex_constants::collate` compile time flag. However if you set a non-default
compile time flag - for example `regex_constants::extended` or
`regex_constants::basic`, then locale dependent collation will be enabled,
this also applies to the POSIX API functions which use either
`regex_constants::extended` or `regex_constants::basic` internally.
[Note - when `regex_constants::nocollate` in effect, the library behaves
"as if" the LC_COLLATE locale category were always "C", regardless of what
its actually set to - end note].
[*Q.] Why are there no throw specifications on any of the functions?
What exceptions can the library throw?
[*A.] Not all compilers support (or honor) throw specifications, others
support them but with reduced efficiency. Throw specifications may be added
at a later date as compilers begin to handle this better. The library
should throw only three types of exception: [boost::regex_error] can be
thrown by [basic_regex] when compiling a regular expression, `std::runtime_error`
can be thrown when a call to `basic_regex::imbue` tries to open a message
catalogue that doesn't exist, or when a call to [regex_search] or [regex_match]
results in an "everlasting" search, or when a call to `RegEx::GrepFiles` or
`RegEx::FindFiles` tries to open a file that cannot be opened, finally
`std::bad_alloc` can be thrown by just about any of the functions in this library.
[*Q.] Why can't I use the "convenience" versions of regex_match /
regex_search / regex_grep / regex_format / regex_merge?
[*A.] These versions may or may not be available depending upon the
capabilities of your compiler, the rules determining the format of
these functions are quite complex - and only the versions visible to
a standard compliant compiler are given in the help. To find out
what your compiler supports, run <boost/regex.hpp> through your
C++ pre-processor, and search the output file for the function
that you are interested in. Note however, that very few current
compilers still have problems with these overloaded functions.
[endsect]

102
doc/format_boost_syntax.qbk Normal file
View File

@ -0,0 +1,102 @@
[/
Copyright 2006-2007 John Maddock.
Distributed under the Boost Software License, Version 1.0.
(See accompanying file LICENSE_1_0.txt or copy at
http://www.boost.org/LICENSE_1_0.txt).
]
[section:boost_format_syntax Boost-Extended Format String Syntax]
Boost-Extended format strings treat all characters as literals except for
'$', '\\', '(', ')', '?', and ':'.
[h4 Grouping]
The characters '(' and ')' perform lexical grouping, so use \\( and \\) if you
want a to output literal parenthesis.
[h4 Conditionals]
The character '?' begins a conditional expression, the general form is:
?Ntrue-expression:false-expression
where N is decimal digit.
If sub-expression N was matched, then true-expression is evaluated and sent to
output, otherwise false-expression is evaluated and sent to output.
You will normally need to surround a conditional-expression with parenthesis in
order to prevent ambiguities.
For example, the format string "(?1foo:bar)" will replace each match found with "foo" if
the sub-expression $1 was matched, and with "bar" otherwise.
For sub-expressions with an index greater than 9, or for access to named sub-expressions use:
?{INDEX}true-expression:false-expression
or
?{NAME}true-expression:false-expression
[h4 Placeholder Sequences]
Placeholder sequences specify that some part of what matched the regular expression
should be sent to output as follows:
[table
[[Placeholder][Meaning]]
[[$&][Outputs what matched the whole expression.]]
[[$MATCH][As $&]]
[[${^MATCH}][As $&]]
[[$\`][Outputs the text between the end of the last match found (or the
start of the text if no previous match was found), and the start
of the current match.]]
[[$PREMATCH][As $\`]]
[[${^PREMATCH}][As $\`]]
[[$'][Outputs all the text following the end of the current match.]]
[[$POSTMATCH][As $']]
[[${^POSTMATCH}][As $']]
[[$+][Outputs what matched the last marked sub-expression in the regular expression.]]
[[$LAST_PAREN_MATCH][As $+]]
[[$LAST_SUBMATCH_RESULT][Outputs what matched the last sub-expression to be actually matched.]]
[[$^N][As $LAST_SUBMATCH_RESULT]]
[[$$][Outputs a literal '$']]
[[$n][Outputs what matched the n'th sub-expression.]]
[[${n}][Outputs what matched the n'th sub-expression.]]
[[$+{NAME}][Outputs whatever matched the sub-expression named "NAME".]]
]
Any $-placeholder sequence not listed above, results in '$' being treated as a literal.
[h4 Escape Sequences]
An escape character followed by any character x, outputs that character unless
x is one of the escape sequences shown below.
[table
[[Escape][Meaning]]
[[\\a][Outputs the bell character: '\\a'.]]
[[\\e][Outputs the ANSI escape character (code point 27).]]
[[\\f][Outputs a form feed character: '\\f']]
[[\\n][Outputs a newline character: '\\n'.]]
[[\\r][Outputs a carriage return character: '\\r'.]]
[[\\t][Outputs a tab character: '\\t'.]]
[[\\v][Outputs a vertical tab character: '\\v'.]]
[[\\xDD][Outputs the character whose hexadecimal code point is 0xDD]]
[[\\x{DDDD}][Outputs the character whose hexadecimal code point is 0xDDDDD]]
[[\\cX][Outputs the ANSI escape sequence "escape-X".]]
[[\\D][If D is a decimal digit in the range 1-9, then outputs the text that matched sub-expression D.]]
[[\\l][Causes the next character to be outputted, to be output in lower case.]]
[[\\u][Causes the next character to be outputted, to be output in upper case.]]
[[\\L][Causes all subsequent characters to be output in lower case, until a \\E is found.]]
[[\\U][Causes all subsequent characters to be output in upper case, until a \\E is found.]]
[[\\E][Terminates a \\L or \\U sequence.]]
]
[endsect]

View File

@ -0,0 +1,69 @@
[/
Copyright 2006-2007 John Maddock.
Distributed under the Boost Software License, Version 1.0.
(See accompanying file LICENSE_1_0.txt or copy at
http://www.boost.org/LICENSE_1_0.txt).
]
[section:perl_format Perl Format String Syntax]
Perl-style format strings treat all characters as literals except
'$' and '\\' which start placeholder and escape sequences respectively.
Placeholder sequences specify that some part of what matched the regular expression
should be sent to output as follows:
[table
[[Placeholder][Meaning]]
[[$&][Outputs what matched the whole expression.]]
[[$MATCH][As $&]]
[[${^MATCH}][As $&]]
[[$\`][Outputs the text between the end of the last match found (or the
start of the text if no previous match was found), and the start
of the current match.]]
[[$PREMATCH][As $\`]]
[[${^PREMATCH}][As $\`]]
[[$'][Outputs all the text following the end of the current match.]]
[[$POSTMATCH][As $']]
[[${^POSTMATCH}][As $']]
[[$+][Outputs what matched the last marked sub-expression in the regular expression.]]
[[$LAST_PAREN_MATCH][As $+]]
[[$LAST_SUBMATCH_RESULT][Outputs what matched the last sub-expression to be actually matched.]]
[[$^N][As $LAST_SUBMATCH_RESULT]]
[[$$][Outputs a literal '$']]
[[$n][Outputs what matched the n'th sub-expression.]]
[[${n}][Outputs what matched the n'th sub-expression.]]
[[$+{NAME}][Outputs whatever matched the sub-expression named "NAME".]]
]
Any $-placeholder sequence not listed above, results in '$' being treated
as a literal.
An escape character followed by any character x, outputs that character unless
x is one of the escape sequences shown below.
[table
[[Escape][Meaning]]
[[\\a][Outputs the bell character: '\\a'.]]
[[\\e][Outputs the ANSI escape character (code point 27).]]
[[\\f][Outputs a form feed character: '\\f']]
[[\\n][Outputs a newline character: '\\n'.]]
[[\\r][Outputs a carriage return character: '\\r'.]]
[[\\t][Outputs a tab character: '\\t'.]]
[[\\v][Outputs a vertical tab character: '\\v'.]]
[[\\xDD][Outputs the character whose hexadecimal code point is 0xDD]]
[[\\x{DDDD}][Outputs the character whose hexadecimal code point is 0xDDDDD]]
[[\\cX][Outputs the ANSI escape sequence "escape-X".]]
[[\\D][If D is a decimal digit in the range 1-9, then outputs the text that matched sub-expression D.]]
[[\\l][Causes the next character to be outputted, to be output in lower case.]]
[[\\u][Causes the next character to be outputted, to be output in upper case.]]
[[\\L][Causes all subsequent characters to be output in lower case, until a \\E is found.]]
[[\\U][Causes all subsequent characters to be output in upper case, until a \\E is found.]]
[[\\E][Terminates a \\L or \\U sequence.]]
]
[endsect]

41
doc/format_sed_syntax.qbk Normal file
View File

@ -0,0 +1,41 @@
[/
Copyright 2006-2007 John Maddock.
Distributed under the Boost Software License, Version 1.0.
(See accompanying file LICENSE_1_0.txt or copy at
http://www.boost.org/LICENSE_1_0.txt).
]
[section:sed_format Sed Format String Syntax]
Sed-style format strings treat all characters as literals except:
[table
[[character][description]]
[[&][The ampersand character is replaced in the output stream by
the whole of what matched the regular expression. Use
\\& to output a literal '&' character.]]
[[\\][Specifies an escape sequence.]]
]
An escape character followed by any character x, outputs that character unless x
is one of the escape sequences shown below.
[table
[[Escape][Meaning]]
[[\\a][Outputs the bell character: '\\a'.]]
[[\\e][Outputs the ANSI escape character (code point 27).]]
[[\\f][Outputs a form feed character: '\\f']]
[[\\n][Outputs a newline character: '\\n'.]]
[[\\r][Outputs a carriage return character: '\\r'.]]
[[\\t][Outputs a tab character: '\\t'.]]
[[\\v][Outputs a vertical tab character: '\\v'.]]
[[\\xDD][Outputs the character whose hexadecimal code point is 0xDD]]
[[\\x{DDDD}][Outputs the character whose hexadecimal code point is 0xDDDDD]]
[[\\cX][Outputs the ANSI escape sequence "escape-X".]]
[[\\D][If D is a decimal digit in the range 1-9, then outputs the text that matched sub-expression D.]]
]
[endsect]

26
doc/format_syntax.qbk Normal file
View File

@ -0,0 +1,26 @@
[/
Copyright 2006-2007 John Maddock.
Distributed under the Boost Software License, Version 1.0.
(See accompanying file LICENSE_1_0.txt or copy at
http://www.boost.org/LICENSE_1_0.txt).
]
[section:format Search and Replace Format String Syntax]
Format strings are used by the algorithm [regex_replace] and by
[match_results_format], and are used to transform one string into another.
There are three kind of format string: [sed_format], [perl_format] and [boost_extended_format].
Alternatively, when the flag `format_literal` is passed to one of these functions,
then the format string is treated as a string literal, and is copied unchanged
to the output.
[include format_sed_syntax.qbk]
[include format_perl_syntax.qbk]
[include format_boost_syntax.qbk]
[endsect]

35
doc/further_info.qbk Normal file
View File

@ -0,0 +1,35 @@
[/
Copyright 2006-2007 John Maddock.
Distributed under the Boost Software License, Version 1.0.
(See accompanying file LICENSE_1_0.txt or copy at
http://www.boost.org/LICENSE_1_0.txt).
]
[section:futher References and Further Information]
The main Perl regular expression tutorial can be found [@http://perldoc.perl.org/perlretut.html here],
there's a much shorter summary of the main features [@https://www.cs.tut.fi/~jkorpela/perl/regexp.html here].
The main book on regular expressions is
[@http://www.oreilly.com/catalog/regex/ Mastering Regular Expressions, published by O'Reilly].
Boost.Regex forms the basis for the regular expression chapter of the [tr1].
The [@http://www.opengroup.org/onlinepubs/7908799/toc.htm Open Unix Specification]
contains a wealth of useful material,
including the POSIX regular expression syntax.
The [@http://www.cs.ucr.edu/~stelo/pattern.html Pattern Matching Pointers]
site is a "must visit" resource for anyone interested in pattern matching.
[@http://glimpse.cs.arizona.edu/ Glimpse and Agrep], use a simplified
regular expression syntax to achieve faster search times.
[@http://glimpse.cs.arizona.edu/udi.html Udi Manber]
and [@http://www.dcc.uchile.cl/~rbaeza/ Ricardo Baeza-Yates] both have a
selection of useful pattern matching papers available from their respective web sites.
[endsect]

22
doc/headers.qbk Normal file
View File

@ -0,0 +1,22 @@
[/
Copyright 2006-2007 John Maddock.
Distributed under the Boost Software License, Version 1.0.
(See accompanying file LICENSE_1_0.txt or copy at
http://www.boost.org/LICENSE_1_0.txt).
]
[section:headers Headers]
There are two main headers used by this library: `<boost/regex.hpp>`
provides full access to the main template library, while `<boost/cregex.hpp>`
provides access to the (deprecated) high level class RegEx, and the
POSIX API functions.
There is also a header containing only forward declarations
`<boost/regex_fwd.hpp>` for use when an interface is dependent upon
[basic_regex], but otherwise does not need the full definitions.
[endsect]

236
doc/history.qbk Normal file
View File

@ -0,0 +1,236 @@
[/
Copyright 2006-2007 John Maddock.
Distributed under the Boost Software License, Version 1.0.
(See accompanying file LICENSE_1_0.txt or copy at
http://www.boost.org/LICENSE_1_0.txt).
]
[section:history History]
New issues should be submitted at [@https://github.com/boostorg/regex/issues https://github.com/boostorg/regex/issues]
Currently open issues can be viewed [@https://github.com/boostorg/regex/issues?q=is%3Aopen+is%3Aissue here].
All issues including closed ones can be viewed [@https://github.com/boostorg/regex/issues?q=is%3Aissue+is%3Aclosed here].
[h4 Boost.Regex-7.0.1 (boost-1.79.0)]
* Minor fix for setting building with -DBOOST_REGEX_MAX_CACHE_BLOCKS=0 and `<atomic>` present.
[h4 Boost.Regex-7.0.0 (Boost-1.78.0)]
* [*Breaking Change:] Change \B to be the opposite of \b as per Perl behaviour.
* Change w32_regex_traits.hpp so that windows.h is no longer included.
* Fxed fuzzing related issues [@https://github.com/boostorg/regex/issues/156 #151], [@https://github.com/boostorg/regex/issues/156 #152], [@https://github.com/boostorg/regex/issues/156 #153], [@https://github.com/boostorg/regex/issues/156 #156].
[h4 Boost.Regex-6.0.0 (Boost-1.77.0)]
* Big change to header only library.
* Deprecate C++03 support.
[h4 Boost.Regex-5.1.4 (Boost-172.0)]
* Minor build fixes, see [@https://github.com/boostorg/regex/issues/89 #89].
[h4 Boost.Regex-5.1.3 (Boost-1.64.0)]
* Compiling with Oracle C++ toolset is no longer restricted to static linking.
* Big effort to de-fuzz the library using libFuzzer and fix identified issues, see: [@https://svn.boost.org/trac/boost/ticket/12818 #12818].
[h4 Boost.Regex-5.1.2 (Boost-1.62.0)]
* Fix buffer over-run error when parsing certain invalid regexes, see [@https://svn.boost.org/trac/boost/ticket/12222 #12222].
* Fix detection of ICU in library build, see [@https://svn.boost.org/trac/boost/ticket/12152 #12152].
* Fix bug in case sensitivity change, see [@https://svn.boost.org/trac/boost/ticket/11940 #11940].
* Allow types wider than int in `\x{}` expressions (for char32_t etc), see [@https://svn.boost.org/trac/boost/ticket/11988 #11988].
[h4 Boost.Regex-5.1.1 (Boost-1.61.0)]
* Change to lockfree implementation of memory cache, see [@https://github.com/boostorg/regex/pull/23 PR#23].
[h4 Boost.Regex-5.1.0 (Boost-1.60.0)]
* Add support for Perl's backtracking control verbs, see [@https://svn.boost.org/trac/boost/ticket/11205 #11205]. Note however, that
(*MARK) and operations on marks are not currently supported.
* Fix incorrect range end when matching \[\[:unicode:\]\], see [@https://svn.boost.org/trac/boost/ticket/11524 #11524].
* Change POSIX reg_comp API to not check potentially uninitialized memory, note that code which was previously free from memory
leaks (but none the less buggy, as it didn't call reg_free) will now leak. See [@https://svn.boost.org/trac/boost/ticket/11472 #11472].
* Make sub_match a valid C++ range type, see [@https://svn.boost.org/trac/boost/ticket/11036 #11036].
[h4 Boost.Regex-5.0.1 (Boost-1.58.0)]
* Fixed some typos as in [@https://svn.boost.org/trac/boost/ticket/10682 #10682].
* Merged [@https://github.com/boostorg/regex/pull/6 pull-request #6] for Coverity warnings.
* Merged [@https://github.com/boostorg/regex/pull/7 pull-request #7] for Coverity warnings.
* Merged [@https://github.com/boostorg/regex/pull/8 pull-request #8] for Coverity warnings.
* Merged [@https://github.com/boostorg/regex/pull/10 pull-request #10] to enable more build variants when linking to ICU.
* Fix issue with ICU and partial matches, see [@https://svn.boost.org/trac/boost/ticket/10114 #10114].
* Removed delayload support for the ICU libraries: this doesn't work with the latest ICU releases (linker errors).
[h4 Boost.Regex-5.0.0 (Boost-1.56.0)]
* Moved to library-specific version number post the move to Git. And since we have one (minor) breaking change
this gets bumped up from v4 to v5.
* [*Breaking change:] corrected behavior of `basic_regex<>::mark_count()` to match existing documentation,
`basic_regex<>::subexpression(n)` changed to match, see [@https://svn.boost.org/trac/boost/ticket/9227 #9227]
* Fixed issue [@https://svn.boost.org/trac/boost/ticket/8903 #8903].
* Fixed documentation typos from [@https://svn.boost.org/trac/boost/ticket/9283 #9283].
* Fixed bug in collation code that failed if the locale generated collation strings with embedded nul's,
see [@https://svn.boost.org/trac/boost/ticket/9451 #9451].
* Apply patch for unusual thread usage (no statically initialized mutexes), see [@https://svn.boost.org/trac/boost/ticket/9461 #9461].
* Added better checks for invalid UTF-8 sequences, see [@https://svn.boost.org/trac/boost/ticket/9473 #9473].
[h4 Boost-1.54]
Fixed issue [@https://svn.boost.org/trac/boost/ticket/8569 #8569].
[h4 Boost-1.53]
Fixed Issues:
[@https://svn.boost.org/trac/boost/ticket/7744 #7744], [@https://svn.boost.org/trac/boost/ticket/7644 #7644].
[h4 Boost-1.51]
Fixed issues:
[@https://svn.boost.org/trac/boost/ticket/589 #589], [@https://svn.boost.org/trac/boost/ticket/7084 #7084],
[@https://svn.boost.org/trac/boost/ticket/7032 #7032], [@https://svn.boost.org/trac/boost/ticket/6346 #6346].
[h4 Boost-1.50]
Fixed issue with `(?!)` not being a valid expression, and updated docs on what constitutes a valid conditional expression.
[h4 Boost-1.48]
Fixed issues:
[@https://svn.boost.org/trac/boost/ticket/688 #698], [@https://svn.boost.org/trac/boost/ticket/5835 #5835],
[@https://svn.boost.org/trac/boost/ticket/5958 #5958], [@https://svn.boost.org/trac/boost/ticket/5736 #5736].
[h4 Boost 1.47]
Fixed issues:
[@https://svn.boost.org/trac/boost/ticket/5223 #5223], [@https://svn.boost.org/trac/boost/ticket/5353 #5353],
[@https://svn.boost.org/trac/boost/ticket/5363 #5363], [@https://svn.boost.org/trac/boost/ticket/5462 #5462],
[@https://svn.boost.org/trac/boost/ticket/5472 #5472], [@https://svn.boost.org/trac/boost/ticket/5504 #5504].
[h4 Boost 1.44]
Fixed issues:
[@https://svn.boost.org/trac/boost/ticket/4309 #4309],
[@https://svn.boost.org/trac/boost/ticket/4215 #4215],
[@https://svn.boost.org/trac/boost/ticket/4212 #4212],
[@https://svn.boost.org/trac/boost/ticket/4191 #4191],
[@https://svn.boost.org/trac/boost/ticket/4132 #4132],
[@https://svn.boost.org/trac/boost/ticket/4123 #4123],
[@https://svn.boost.org/trac/boost/ticket/4114 #4114],
[@https://svn.boost.org/trac/boost/ticket/4036 #4036],
[@https://svn.boost.org/trac/boost/ticket/4020 #4020],
[@https://svn.boost.org/trac/boost/ticket/3941 #3941],
[@https://svn.boost.org/trac/boost/ticket/3902 #3902],
[@https://svn.boost.org/trac/boost/ticket/3890 #3890]
[h4 Boost 1.42]
* Added support for Functors rather than strings as format expressions.
* Improved error reporting when throwing exceptions to include better more relevant information.
* Improved performance and reduced stack usage of recursive expressions.
* Fixed tickets
[@https://svn.boost.org/trac/boost/ticket/2802 #2802],
[@https://svn.boost.org/trac/boost/ticket/3425 #3425],
[@https://svn.boost.org/trac/boost/ticket/3507 #3507],
[@https://svn.boost.org/trac/boost/ticket/3546 #3546],
[@https://svn.boost.org/trac/boost/ticket/3631 #3631],
[@https://svn.boost.org/trac/boost/ticket/3632 #3632],
[@https://svn.boost.org/trac/boost/ticket/3715 #3715],
[@https://svn.boost.org/trac/boost/ticket/3718 #3718],
[@https://svn.boost.org/trac/boost/ticket/3763 #3763],
[@https://svn.boost.org/trac/boost/ticket/3764 #3764]
[h4 Boost 1.40]
* Added support for many Perl 5.10 syntax elements including named
sub-expressions, branch resets and recursive regular expressions.
[h4 Boost 1.38]
* [*Breaking change]: empty expressions, and empty alternatives are now
allowed when using the Perl regular expression syntax. This change has
been added for Perl compatibility, when the new [syntax_option_type]
['no_empty_expressions] is set then the old behaviour is preserved and
empty expressions are prohibited. This is issue
[@https://svn.boost.org/trac/boost/ticket/1081 #1081].
* Added support for Perl style ${n} expressions in format strings
(issue [@https://svn.boost.org/trac/boost/ticket/2556 #2556]).
* Added support for accessing the location of sub-expressions within the
regular expression string
(issue [@https://svn.boost.org/trac/boost/ticket/2269 #2269]).
* Fixed compiler compatibility issues
[@https://svn.boost.org/trac/boost/ticket/2244 #2244],
[@https://svn.boost.org/trac/boost/ticket/2514 #2514],
and
[@https://svn.boost.org/trac/boost/ticket/2244 #2458].
[h4 Boost 1.34]
* Fix for non-greedy repeats and partial matches not working correctly in some cases.
* Fix for non-greedy repeats on VC++ not working in some cases (bug report 1515830).
* Changed match_results::position() to return a valid result when *this represents a partial match.
* Fixed the grep and egrep options so that the newline character gets treated the same as |.
[h4 Boost 1.33.1]
* Fixed broken makefiles.
* Fixed configuration setup to allow building with VC7.1 - STLport-4.6.2 when using /Zc:wchar_t.
* Moved declarations class-inline in static_mutex.hpp so that SGI Irix compiler can cope.
* Added needed standard library #includes to fileiter.hpp, regex_workaround.hpp and cpp_regex_traits.hpp.
* Fixed a bug where non-greedy repeats could in certain strange circumstances repeat more times than their maximum value.
* Fixed the value returned by basic_regex<>::empty() from a default constructed object.
* Changed the definition of regex_error to make it backwards compatible with Boost-1.32.0.
* Disabled external templates for Intel C++ 8.0 and earlier - otherwise unresolved references can occur.
* Rewritten extern template code for gcc so that only specific member functions are exported: otherwise strange unresolved references can occur when linking and mixing debug and non-debug code.
* Initialise all the data members of the unicode_iterators: this keeps gcc from issuing needless warnings.
* Ported the ICU integration code to VC6 and VC7.
* Ensured code is STLport debug mode clean.
* Fixed lookbehind assertions so that fixed length repeats are permitted, and so that regex iteration allows lookbehind to look back before the current search range (into the last match).
* Fixed strange bug with non-greedy repeats inside forward lookahead assertions.
* Enabled negated character classes inside character sets.
* Fixed regression so that [a-z-] is a valid expression again.
* Fixed bug that allowed some invalid expressions to be accepted.
[h4 Boost 1.33.0]
* Completely rewritten expression parsing code, and traits class support; now conforms to the standardization proposal.
* Breaking Change: The syntax options that can be passed to basic_regex constructors have been rationalized. The default option (perl) now has a value of zero, and it is now clearly documented which options apply to which regular expression syntax styles (perl, POSIX-extended, POSIX-basic etc). Some of the more esoteric options have now been removed, so there is the possibility that existing code may fail to compile: however equivalent functionality should still be available.
* Breaking Change: POSIX-extended and POSIX-basic regular expressions now enforce the letter of the POSIX standard much more closely than before.
* Added support for (?imsx-imsx) constructs.
* Added support for lookbehind expressions (?<=positive-lookbehind) and (?<!negative-lookbehind).
* Added support for conditional expressions (?(assertion)true-expression|false-expression).
* Added MFC/ATL string wrappers.
* Added Unicode support; based on ICU.
* Changed newline support to recognise \\f as a line separator (all character types), and \\x85 as a line separator for wide characters / Unicode only.
* Added a new format flag format_literal that treats the replace string as a literal, rather than a Perl or Sed style format string.
* Errors are now reported by throwing exceptions of type regex_error. The types used previously - bad_expression and bad_pattern - are now just typedefs for regex_error. Type regex_error has a couple of new members: code() to report an error code rather than a string, and position() to report where in the expression the error occurred.
[h4 Boost 1.32.1]
* Fixed bug in partial matches of bounded repeats of '.'.
[h4 Boost 1.31.0]
* Completely rewritten pattern matching code - it is now up to 10 times faster than before.
* Reorganized documentation.
* Deprecated all interfaces that are not part of the regular expression standardization proposal.
* Added regex_iterator and regex_token_iterator .
* Added support for Perl style independent sub-expressions.
* Added non-member operators to the sub_match class, so that you can compare sub_match's with strings, or add them to a string to produce a new string.
* Added experimental support for extended capture information.
* Changed the match flags so that they are a distinct type (not an integer), if you try to pass the match flags as an integer rather than match_flag_type to the regex algorithms then you will now get a compiler error.
[endsect]

View File

@ -0,0 +1,80 @@
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title>Background Information</title>
<link rel="stylesheet" href="../../../../../doc/src/boostbook.css" type="text/css">
<meta name="generator" content="DocBook XSL Stylesheets V1.79.1">
<link rel="home" href="../index.html" title="Boost.Regex 7.0.1">
<link rel="up" href="../index.html" title="Boost.Regex 7.0.1">
<link rel="prev" href="ref/internals/uni_iter.html" title="Unicode Iterators">
<link rel="next" href="background/headers.html" title="Headers">
</head>
<body bgcolor="white" text="black" link="#0000FF" vlink="#840084" alink="#0000FF">
<table cellpadding="2" width="100%"><tr>
<td valign="top"><img alt="Boost C++ Libraries" width="277" height="86" src="../../../../../boost.png"></td>
<td align="center"><a href="../../../../../index.html">Home</a></td>
<td align="center"><a href="../../../../../libs/libraries.htm">Libraries</a></td>
<td align="center"><a href="http://www.boost.org/users/people.html">People</a></td>
<td align="center"><a href="http://www.boost.org/users/faq.html">FAQ</a></td>
<td align="center"><a href="../../../../../more/index.htm">More</a></td>
</tr></table>
<hr>
<div class="spirit-nav">
<a accesskey="p" href="ref/internals/uni_iter.html"><img src="../../../../../doc/src/images/prev.png" alt="Prev"></a><a accesskey="u" href="../index.html"><img src="../../../../../doc/src/images/up.png" alt="Up"></a><a accesskey="h" href="../index.html"><img src="../../../../../doc/src/images/home.png" alt="Home"></a><a accesskey="n" href="background/headers.html"><img src="../../../../../doc/src/images/next.png" alt="Next"></a>
</div>
<div class="section">
<div class="titlepage"><div><div><h2 class="title" style="clear: both">
<a name="boost_regex.background"></a><a class="link" href="background.html" title="Background Information">Background Information</a>
</h2></div></div></div>
<div class="toc"><dl class="toc">
<dt><span class="section"><a href="background/headers.html">Headers</a></span></dt>
<dt><span class="section"><a href="background/locale.html">Localization</a></span></dt>
<dt><span class="section"><a href="background/thread_safety.html">Thread Safety</a></span></dt>
<dt><span class="section"><a href="background/examples.html">Test and Example Programs</a></span></dt>
<dt><span class="section"><a href="background/futher.html">References and Further
Information</a></span></dt>
<dt><span class="section"><a href="background/faq.html">FAQ</a></span></dt>
<dt><span class="section"><a href="background/performance.html">Performance</a></span></dt>
<dd><dl>
<dt><span class="section"><a href="background/performance/section_id1378460593.html">Testing
simple leftmost-longest matches (platform = linux, compiler = GNU C++ version
6.3.0)</a></span></dt>
<dt><span class="section"><a href="background/performance/section_id1675827111.html">Testing
Perl searches (platform = linux, compiler = GNU C++ version 6.3.0)</a></span></dt>
<dt><span class="section"><a href="background/performance/section_id3141719723.html">Testing
simple leftmost-longest matches (platform = Windows x64, compiler = Microsoft
Visual C++ version 14.1)</a></span></dt>
<dt><span class="section"><a href="background/performance/section_id3258595385.html">Testing
leftmost-longest searches (platform = Windows x64, compiler = Microsoft Visual
C++ version 14.1)</a></span></dt>
<dt><span class="section"><a href="background/performance/section_id3261825021.html">Testing
simple Perl matches (platform = linux, compiler = GNU C++ version 6.3.0)</a></span></dt>
<dt><span class="section"><a href="background/performance/section_id3752650613.html">Testing
Perl searches (platform = Windows x64, compiler = Microsoft Visual C++ version
14.1)</a></span></dt>
<dt><span class="section"><a href="background/performance/section_id4128344975.html">Testing
simple Perl matches (platform = Windows x64, compiler = Microsoft Visual
C++ version 14.1)</a></span></dt>
<dt><span class="section"><a href="background/performance/section_id4148872883.html">Testing
leftmost-longest searches (platform = linux, compiler = GNU C++ version 6.3.0)</a></span></dt>
</dl></dd>
<dt><span class="section"><a href="background/standards.html">Standards Conformance</a></span></dt>
<dt><span class="section"><a href="background/redist.html">Redistributables</a></span></dt>
<dt><span class="section"><a href="background/acknowledgements.html">Acknowledgements</a></span></dt>
<dt><span class="section"><a href="background/history.html">History</a></span></dt>
</dl></div>
</div>
<table xmlns:rev="http://www.cs.rpi.edu/~gregod/boost/tools/doc/revision" width="100%"><tr>
<td align="left"></td>
<td align="right"><div class="copyright-footer">Copyright © 1998-2013 John Maddock<p>
Distributed under the Boost Software License, Version 1.0. (See accompanying
file LICENSE_1_0.txt or copy at <a href="http://www.boost.org/LICENSE_1_0.txt" target="_top">http://www.boost.org/LICENSE_1_0.txt</a>)
</p>
</div></td>
</tr></table>
<hr>
<div class="spirit-nav">
<a accesskey="p" href="ref/internals/uni_iter.html"><img src="../../../../../doc/src/images/prev.png" alt="Prev"></a><a accesskey="u" href="../index.html"><img src="../../../../../doc/src/images/up.png" alt="Up"></a><a accesskey="h" href="../index.html"><img src="../../../../../doc/src/images/home.png" alt="Home"></a><a accesskey="n" href="background/headers.html"><img src="../../../../../doc/src/images/next.png" alt="Next"></a>
</div>
</body>
</html>

View File

@ -0,0 +1,87 @@
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title>Acknowledgements</title>
<link rel="stylesheet" href="../../../../../../doc/src/boostbook.css" type="text/css">
<meta name="generator" content="DocBook XSL Stylesheets V1.79.1">
<link rel="home" href="../../index.html" title="Boost.Regex 7.0.1">
<link rel="up" href="../background.html" title="Background Information">
<link rel="prev" href="redist.html" title="Redistributables">
<link rel="next" href="history.html" title="History">
</head>
<body bgcolor="white" text="black" link="#0000FF" vlink="#840084" alink="#0000FF">
<table cellpadding="2" width="100%"><tr>
<td valign="top"><img alt="Boost C++ Libraries" width="277" height="86" src="../../../../../../boost.png"></td>
<td align="center"><a href="../../../../../../index.html">Home</a></td>
<td align="center"><a href="../../../../../../libs/libraries.htm">Libraries</a></td>
<td align="center"><a href="http://www.boost.org/users/people.html">People</a></td>
<td align="center"><a href="http://www.boost.org/users/faq.html">FAQ</a></td>
<td align="center"><a href="../../../../../../more/index.htm">More</a></td>
</tr></table>
<hr>
<div class="spirit-nav">
<a accesskey="p" href="redist.html"><img src="../../../../../../doc/src/images/prev.png" alt="Prev"></a><a accesskey="u" href="../background.html"><img src="../../../../../../doc/src/images/up.png" alt="Up"></a><a accesskey="h" href="../../index.html"><img src="../../../../../../doc/src/images/home.png" alt="Home"></a><a accesskey="n" href="history.html"><img src="../../../../../../doc/src/images/next.png" alt="Next"></a>
</div>
<div class="section">
<div class="titlepage"><div><div><h3 class="title">
<a name="boost_regex.background.acknowledgements"></a><a class="link" href="acknowledgements.html" title="Acknowledgements">Acknowledgements</a>
</h3></div></div></div>
<p>
The author can be contacted at john - at - johnmaddock.co.uk; the home page
for this library is at <a href="http://www.boost.org" target="_top">www.boost.org</a>.
</p>
<p>
I am indebted to <a href="http://www.cs.princeton.edu/~rs/" target="_top">Robert Sedgewick's
"Algorithms in C++"</a> for forcing me to think about algorithms
and their performance, and to the folks at boost for forcing me to think,
period.
</p>
<p>
<a href="http://www.boost-consulting.com/" target="_top">Eric Niebler</a>, author
of Boost.Expressive and the <a href="http://research.microsoft.com/projects/greta" target="_top">GRETA
regular expression component</a>, has shared several important ideas,
in a series of long discussions.
</p>
<p>
Pete Becker, of <a href="http://www.versatilecoding.com" target="_top">Roundhouse Consulting,
Ltd.</a>, has helped enormously with the standardisation proposal language.
</p>
<p>
The following people have all contributed useful comments or fixes: Dave
Abrahams, Mike Allison, Edan Ayal, Jayashree Balasubramanian, Jan Bölsche,
Beman Dawes, Paul Baxter, David Bergman, David Dennerline, Edward Diener,
Peter Dimov, Robert Dunn, Fabio Forno, Tobias Gabrielsson, Rob Gillen, Marc
Gregoire, Chris Hecker, Nick Hodapp, Jesse Jones, Martin Jost, Boris Krasnovskiy,
Jan Hermelink, Max Leung, Wei-hao Lin, Jens Maurer, Richard Peters, Heiko
Schmidt, Jason Shirk, Gerald Slacik, Scobie Smith, Mike Smyth, Alexander
Sokolovsky, Hervé Poirier, Michael Raykh, Marc Recht, Scott VanCamp, Bruno
Voigt, Alexey Voinov, Jerry Waldorf, Rob Ward, Lealon Watts, John Wismar,
Thomas Witt and Yuval Yosef.
</p>
<p>
If I've missed your name off (I'm sure there are a few, just not who they
are...) then please do get in touch.
</p>
<p>
I am also grateful to the manuals supplied with the Henry Spencer, PCRE,
Perl and GNU regular expression libraries - wherever possible I have tried
to maintain compatibility with these libraries and with the POSIX standard
- the code however is entirely my own, including any bugs! I can absolutely
guarantee that I will not fix any bugs I don't know about, so if you have
any comments or spot any bugs, please get in touch.
</p>
</div>
<table xmlns:rev="http://www.cs.rpi.edu/~gregod/boost/tools/doc/revision" width="100%"><tr>
<td align="left"></td>
<td align="right"><div class="copyright-footer">Copyright © 1998-2013 John Maddock<p>
Distributed under the Boost Software License, Version 1.0. (See accompanying
file LICENSE_1_0.txt or copy at <a href="http://www.boost.org/LICENSE_1_0.txt" target="_top">http://www.boost.org/LICENSE_1_0.txt</a>)
</p>
</div></td>
</tr></table>
<hr>
<div class="spirit-nav">
<a accesskey="p" href="redist.html"><img src="../../../../../../doc/src/images/prev.png" alt="Prev"></a><a accesskey="u" href="../background.html"><img src="../../../../../../doc/src/images/up.png" alt="Up"></a><a accesskey="h" href="../../index.html"><img src="../../../../../../doc/src/images/home.png" alt="Home"></a><a accesskey="n" href="history.html"><img src="../../../../../../doc/src/images/next.png" alt="Next"></a>
</div>
</body>
</html>

View File

@ -0,0 +1,274 @@
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title>Test and Example Programs</title>
<link rel="stylesheet" href="../../../../../../doc/src/boostbook.css" type="text/css">
<meta name="generator" content="DocBook XSL Stylesheets V1.79.1">
<link rel="home" href="../../index.html" title="Boost.Regex 7.0.1">
<link rel="up" href="../background.html" title="Background Information">
<link rel="prev" href="thread_safety.html" title="Thread Safety">
<link rel="next" href="futher.html" title="References and Further Information">
</head>
<body bgcolor="white" text="black" link="#0000FF" vlink="#840084" alink="#0000FF">
<table cellpadding="2" width="100%"><tr>
<td valign="top"><img alt="Boost C++ Libraries" width="277" height="86" src="../../../../../../boost.png"></td>
<td align="center"><a href="../../../../../../index.html">Home</a></td>
<td align="center"><a href="../../../../../../libs/libraries.htm">Libraries</a></td>
<td align="center"><a href="http://www.boost.org/users/people.html">People</a></td>
<td align="center"><a href="http://www.boost.org/users/faq.html">FAQ</a></td>
<td align="center"><a href="../../../../../../more/index.htm">More</a></td>
</tr></table>
<hr>
<div class="spirit-nav">
<a accesskey="p" href="thread_safety.html"><img src="../../../../../../doc/src/images/prev.png" alt="Prev"></a><a accesskey="u" href="../background.html"><img src="../../../../../../doc/src/images/up.png" alt="Up"></a><a accesskey="h" href="../../index.html"><img src="../../../../../../doc/src/images/home.png" alt="Home"></a><a accesskey="n" href="futher.html"><img src="../../../../../../doc/src/images/next.png" alt="Next"></a>
</div>
<div class="section">
<div class="titlepage"><div><div><h3 class="title">
<a name="boost_regex.background.examples"></a><a class="link" href="examples.html" title="Test and Example Programs">Test and Example Programs</a>
</h3></div></div></div>
<h5>
<a name="boost_regex.background.examples.h0"></a>
<span class="phrase"><a name="boost_regex.background.examples.test_programs"></a></span><a class="link" href="examples.html#boost_regex.background.examples.test_programs">Test
Programs</a>
</h5>
<p>
<span class="bold"><strong>regress:</strong></span>
</p>
<p>
A regression test application that gives the matching/searching algorithms
a full workout. The presence of this program is your guarantee that the library
will behave as claimed - at least as far as those items tested are concerned
- if anyone spots anything that isn't being tested I'd be glad to hear about
it.
</p>
<p>
Files:
</p>
<div class="itemizedlist"><ul class="itemizedlist" style="list-style-type: disc; ">
<li class="listitem">
<a href="../../../../test/regress/main.cpp" target="_top">main.cpp</a>
</li>
<li class="listitem">
<a href="../../../../test/regress/basic_tests.cpp" target="_top">basic_tests.cpp</a>
</li>
<li class="listitem">
<a href="../../../../test/regress/test_alt.cpp" target="_top">test_alt.cpp</a>
</li>
<li class="listitem">
<a href="../../../../test/regress/test_anchors.cpp" target="_top">test_anchors.cpp</a>
</li>
<li class="listitem">
<a href="../../../../test/regress/test_asserts.cpp" target="_top">test_asserts.cpp</a>
</li>
<li class="listitem">
<a href="../../../../test/regress/test_backrefs.cpp" target="_top">test_backrefs.cpp</a>
</li>
<li class="listitem">
<a href="../../../../test/regress/test_deprecated.cpp" target="_top">test_deprecated.cpp</a>
</li>
<li class="listitem">
<a href="../../../../test/regress/test_emacs.cpp" target="_top">test_emacs.cpp</a>
</li>
<li class="listitem">
<a href="../../../../test/regress/test_escapes.cpp" target="_top">test_escapes.cpp</a>
</li>
<li class="listitem">
<a href="../../../../test/regress/test_grep.cpp" target="_top">test_grep.cpp</a>
</li>
<li class="listitem">
<a href="../../../../test/regress/test_icu.cpp" target="_top">test_icu.cpp</a>
</li>
<li class="listitem">
<a href="../../../../test/regress/test_locale.cpp" target="_top">test_locale.cpp</a>
</li>
<li class="listitem">
<a href="../../../../test/regress/test_mfc.cpp" target="_top">test_mfc.cpp</a>
</li>
<li class="listitem">
<a href="../../../../test/regress/test_non_greedy_repeats.cpp" target="_top">test_non_greedy_repeats.cpp</a>
</li>
<li class="listitem">
<a href="../../../../test/regress/test_operators.cpp" target="_top">test_operators.cpp</a>
</li>
<li class="listitem">
<a href="../../../../test/regress/test_overloads.cpp" target="_top">test_overloads.cpp</a>
</li>
<li class="listitem">
<a href="../../../../test/regress/test_perl_ex.cpp" target="_top">test_perl_ex.cpp</a>
</li>
<li class="listitem">
<a href="../../../../test/regress/test_replace.cpp" target="_top">test_replace.cpp</a>
</li>
<li class="listitem">
<a href="../../../../test/regress/test_sets.cpp" target="_top">test_sets.cpp</a>
</li>
<li class="listitem">
<a href="../../../../test/regress/test_simple_repeats.cpp" target="_top">test_simple_repeats.cpp</a>
</li>
<li class="listitem">
<a href="../../../../test/regress/test_tricky_cases.cpp" target="_top">test_tricky_cases.cpp</a>
</li>
<li class="listitem">
<a href="../../../../test/regress/test_unicode.cpp" target="_top">test_unicode.cpp</a>
</li>
</ul></div>
<p>
<span class="bold"><strong>bad_expression_test:</strong></span>
</p>
<p>
Verifies that "bad" regular expressions don't cause the matcher
to go into infinite loops, but to throw an exception instead.
</p>
<p>
Files: <a href="../../../../test/pathology/bad_expression_test.cpp" target="_top">bad_expression_test.cpp</a>.
</p>
<p>
<span class="bold"><strong>recursion_test:</strong></span>
</p>
<p>
Verifies that the matcher can't overrun the stack (no matter what the expression).
</p>
<p>
Files: <a href="../../../../test/pathology/recursion_test.cpp" target="_top">recursion_test.cpp</a>.
</p>
<p>
<span class="bold"><strong>concepts:</strong></span>
</p>
<p>
Verifies that the library meets all documented concepts (a compile only test).
</p>
<p>
Files: <a href="../../../../test/concepts/concept_check.cpp" target="_top">concept_check.cpp</a>.
</p>
<p>
<span class="bold"><strong>captures_test:</strong></span>
</p>
<p>
Test code for captures.
</p>
<p>
Files: <a href="../../../../test/captures/captures_test.cpp" target="_top">captures_test.cpp</a>.
</p>
<h5>
<a name="boost_regex.background.examples.h1"></a>
<span class="phrase"><a name="boost_regex.background.examples.example_programs"></a></span><a class="link" href="examples.html#boost_regex.background.examples.example_programs">Example
programs</a>
</h5>
<p>
<span class="bold"><strong>grep</strong></span>
</p>
<p>
A simple grep implementation, run with the -h command line option to find
out its usage.
</p>
<p>
Files: <a href="../../../../example/grep/grep.cpp" target="_top">grep.cpp</a>
</p>
<p>
<span class="bold"><strong>timer.exe</strong></span>
</p>
<p>
A simple interactive expression matching application, the results of all
matches are timed, allowing the programmer to optimize their regular expressions
where performance is critical.
</p>
<p>
Files: <a href="../../../../example/timer/regex_timer.cpp" target="_top">regex_timer.cpp</a>.
</p>
<h5>
<a name="boost_regex.background.examples.h2"></a>
<span class="phrase"><a name="boost_regex.background.examples.code_snippets"></a></span><a class="link" href="examples.html#boost_regex.background.examples.code_snippets">Code
snippets</a>
</h5>
<p>
The snippets examples contain the code examples used in the documentation:
</p>
<p>
<a href="../../../../example/snippets/captures_example.cpp" target="_top">captures_example.cpp</a>:
Demonstrates the use of captures.
</p>
<p>
<a href="../../../../example/snippets/credit_card_example.cpp" target="_top">credit_card_example.cpp</a>:
Credit card number formatting code.
</p>
<p>
<a href="../../../../example/snippets/partial_regex_grep.cpp" target="_top">partial_regex_grep.cpp</a>:
Search example using partial matches.
</p>
<p>
<a href="../../../../example/snippets/partial_regex_match.cpp" target="_top">partial_regex_match.cpp</a>:
regex_match example using partial matches.
</p>
<p>
<a href="../../../../example/snippets/regex_iterator_example.cpp" target="_top">regex_iterator_example.cpp</a>:
Iterating through a series of matches.
</p>
<p>
<a href="../../../../example/snippets/regex_match_example.cpp" target="_top">regex_match_example.cpp</a>:
ftp based regex_match example.
</p>
<p>
<a href="../../../../example/snippets/regex_merge_example.cpp" target="_top">regex_merge_example.cpp</a>:
regex_merge example: converts a C++ file to syntax highlighted HTML.
</p>
<p>
<a href="../../../../example/snippets/regex_replace_example.cpp" target="_top">regex_replace_example.cpp</a>:
regex_replace example: converts a C++ file to syntax highlighted HTML
</p>
<p>
<a href="../../../../example/snippets/regex_search_example.cpp" target="_top">regex_search_example.cpp</a>:
regex_search example: searches a cpp file for class definitions.
</p>
<p>
<a href="../../../../example/snippets/regex_token_iterator_eg_1.cpp" target="_top">regex_token_iterator_eg_1.cpp</a>:
split a string into a series of tokens.
</p>
<p>
<a href="../../../../example/snippets/regex_token_iterator_eg_2.cpp" target="_top">regex_token_iterator_eg_2.cpp</a>:
enumerate the linked URL's in a HTML file.
</p>
<p>
The following are deprecated:
</p>
<p>
<a href="../../../../example/snippets/regex_grep_example_1.cpp" target="_top">regex_grep_example_1.cpp</a>:
regex_grep example 1: searches a cpp file for class definitions.
</p>
<p>
<a href="../../../../example/snippets/regex_grep_example_2.cpp" target="_top">regex_grep_example_2.cpp</a>:
regex_grep example 2: searches a cpp file for class definitions, using a
global callback function.
</p>
<p>
<a href="../../../../example/snippets/regex_grep_example_3.cpp" target="_top">regex_grep_example_3.cpp</a>:
regex_grep example 2: searches a cpp file for class definitions, using a
bound member function callback.
</p>
<p>
<a href="../../../../example/snippets/regex_grep_example_4.cpp" target="_top">regex_grep_example_4.cpp</a>:
regex_grep example 2: searches a cpp file for class definitions, using a
C++ Builder closure as a callback.
</p>
<p>
<a href="../../../../example/snippets/regex_split_example_1.cpp" target="_top">regex_split_example_1.cpp</a>:
regex_split example: split a string into tokens.
</p>
<p>
<a href="../../../../example/snippets/regex_split_example_2.cpp" target="_top">regex_split_example_2.cpp</a>
: regex_split example: spit out linked URL's.
</p>
</div>
<table xmlns:rev="http://www.cs.rpi.edu/~gregod/boost/tools/doc/revision" width="100%"><tr>
<td align="left"></td>
<td align="right"><div class="copyright-footer">Copyright © 1998-2013 John Maddock<p>
Distributed under the Boost Software License, Version 1.0. (See accompanying
file LICENSE_1_0.txt or copy at <a href="http://www.boost.org/LICENSE_1_0.txt" target="_top">http://www.boost.org/LICENSE_1_0.txt</a>)
</p>
</div></td>
</tr></table>
<hr>
<div class="spirit-nav">
<a accesskey="p" href="thread_safety.html"><img src="../../../../../../doc/src/images/prev.png" alt="Prev"></a><a accesskey="u" href="../background.html"><img src="../../../../../../doc/src/images/up.png" alt="Up"></a><a accesskey="h" href="../../index.html"><img src="../../../../../../doc/src/images/home.png" alt="Home"></a><a accesskey="n" href="futher.html"><img src="../../../../../../doc/src/images/next.png" alt="Next"></a>
</div>
</body>
</html>

View File

@ -0,0 +1,155 @@
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title>FAQ</title>
<link rel="stylesheet" href="../../../../../../doc/src/boostbook.css" type="text/css">
<meta name="generator" content="DocBook XSL Stylesheets V1.79.1">
<link rel="home" href="../../index.html" title="Boost.Regex 7.0.1">
<link rel="up" href="../background.html" title="Background Information">
<link rel="prev" href="futher.html" title="References and Further Information">
<link rel="next" href="performance.html" title="Performance">
</head>
<body bgcolor="white" text="black" link="#0000FF" vlink="#840084" alink="#0000FF">
<table cellpadding="2" width="100%"><tr>
<td valign="top"><img alt="Boost C++ Libraries" width="277" height="86" src="../../../../../../boost.png"></td>
<td align="center"><a href="../../../../../../index.html">Home</a></td>
<td align="center"><a href="../../../../../../libs/libraries.htm">Libraries</a></td>
<td align="center"><a href="http://www.boost.org/users/people.html">People</a></td>
<td align="center"><a href="http://www.boost.org/users/faq.html">FAQ</a></td>
<td align="center"><a href="../../../../../../more/index.htm">More</a></td>
</tr></table>
<hr>
<div class="spirit-nav">
<a accesskey="p" href="futher.html"><img src="../../../../../../doc/src/images/prev.png" alt="Prev"></a><a accesskey="u" href="../background.html"><img src="../../../../../../doc/src/images/up.png" alt="Up"></a><a accesskey="h" href="../../index.html"><img src="../../../../../../doc/src/images/home.png" alt="Home"></a><a accesskey="n" href="performance.html"><img src="../../../../../../doc/src/images/next.png" alt="Next"></a>
</div>
<div class="section">
<div class="titlepage"><div><div><h3 class="title">
<a name="boost_regex.background.faq"></a><a class="link" href="faq.html" title="FAQ">FAQ</a>
</h3></div></div></div>
<p>
<span class="bold"><strong>Q.</strong></span> I can't get regex++ to work with escape
characters, what's going on?
</p>
<p>
<span class="bold"><strong>A.</strong></span> If you embed regular expressions in C++
code, then remember that escape characters are processed twice: once by the
C++ compiler, and once by the Boost.Regex expression compiler, so to pass
the regular expression \d+ to Boost.Regex, you need to embed "\d+"
in your code. Likewise to match a literal backslash you will need to embed
"\\" in your code.
</p>
<p>
<span class="bold"><strong>Q.</strong></span> No matter what I do regex_match always
returns false, what's going on?
</p>
<p>
<span class="bold"><strong>A.</strong></span> The algorithm regex_match only succeeds
if the expression matches <span class="bold"><strong>all</strong></span> of the text,
if you want to <span class="bold"><strong>find</strong></span> a sub-string within
the text that matches the expression then use regex_search instead.
</p>
<p>
<span class="bold"><strong>Q.</strong></span> Why does using parenthesis in a POSIX
regular expression change the result of a match?
</p>
<p>
<span class="bold"><strong>A.</strong></span> For POSIX (extended and basic) regular
expressions, but not for perl regexes, parentheses don't only mark; they
determine what the best match is as well. When the expression is compiled
as a POSIX basic or extended regex then Boost.Regex follows the POSIX standard
leftmost longest rule for determining what matched. So if there is more than
one possible match after considering the whole expression, it looks next
at the first sub-expression and then the second sub-expression and so on.
So...
</p>
<p>
"(0*)([0-9]*)" against "00123" would produce $1 = "00"
$2 = "123"
</p>
<p>
where as
</p>
<p>
"0*([0-9])*" against "00123" would produce $1 = "00123"
</p>
<p>
If you think about it, had $1 only matched the "123", this would
be "less good" than the match "00123" which is both further
to the left and longer. If you want $1 to match only the "123"
part, then you need to use something like:
</p>
<p>
"0*([1-9][0-9]*)"
</p>
<p>
as the expression.
</p>
<p>
<span class="bold"><strong>Q.</strong></span> Why don't character ranges work properly
(POSIX mode only)?
</p>
<p>
<span class="bold"><strong>A.</strong></span> The POSIX standard specifies that character
range expressions are locale sensitive - so for example the expression [A-Z]
will match any collating element that collates between 'A' and 'Z'. That
means that for most locales other than "C" or "POSIX",
[A-Z] would match the single character 't' for example, which is not what
most people expect - or at least not what most people have come to expect
from regular expression engines. For this reason, the default behaviour of
Boost.Regex (perl mode) is to turn locale sensitive collation off by not
setting the <code class="computeroutput"><span class="identifier">regex_constants</span><span class="special">::</span><span class="identifier">collate</span></code>
compile time flag. However if you set a non-default compile time flag - for
example <code class="computeroutput"><span class="identifier">regex_constants</span><span class="special">::</span><span class="identifier">extended</span></code> or <code class="computeroutput"><span class="identifier">regex_constants</span><span class="special">::</span><span class="identifier">basic</span></code>,
then locale dependent collation will be enabled, this also applies to the
POSIX API functions which use either <code class="computeroutput"><span class="identifier">regex_constants</span><span class="special">::</span><span class="identifier">extended</span></code>
or <code class="computeroutput"><span class="identifier">regex_constants</span><span class="special">::</span><span class="identifier">basic</span></code> internally. [Note - when <code class="computeroutput"><span class="identifier">regex_constants</span><span class="special">::</span><span class="identifier">nocollate</span></code> in effect, the library behaves
"as if" the LC_COLLATE locale category were always "C",
regardless of what its actually set to - end note].
</p>
<p>
<span class="bold"><strong>Q.</strong></span> Why are there no throw specifications
on any of the functions? What exceptions can the library throw?
</p>
<p>
<span class="bold"><strong>A.</strong></span> Not all compilers support (or honor)
throw specifications, others support them but with reduced efficiency. Throw
specifications may be added at a later date as compilers begin to handle
this better. The library should throw only three types of exception: [boost::regex_error]
can be thrown by <a class="link" href="../ref/basic_regex.html" title="basic_regex"><code class="computeroutput"><span class="identifier">basic_regex</span></code></a> when compiling a regular
expression, <code class="computeroutput"><span class="identifier">std</span><span class="special">::</span><span class="identifier">runtime_error</span></code> can be thrown when a call
to <code class="computeroutput"><span class="identifier">basic_regex</span><span class="special">::</span><span class="identifier">imbue</span></code> tries to open a message catalogue
that doesn't exist, or when a call to <a class="link" href="../ref/regex_search.html" title="regex_search"><code class="computeroutput"><span class="identifier">regex_search</span></code></a> or <a class="link" href="../ref/regex_match.html" title="regex_match"><code class="computeroutput"><span class="identifier">regex_match</span></code></a> results in an "everlasting"
search, or when a call to <code class="computeroutput"><span class="identifier">RegEx</span><span class="special">::</span><span class="identifier">GrepFiles</span></code>
or <code class="computeroutput"><span class="identifier">RegEx</span><span class="special">::</span><span class="identifier">FindFiles</span></code> tries to open a file that cannot
be opened, finally <code class="computeroutput"><span class="identifier">std</span><span class="special">::</span><span class="identifier">bad_alloc</span></code> can be thrown by just about any
of the functions in this library.
</p>
<p>
<span class="bold"><strong>Q.</strong></span> Why can't I use the "convenience"
versions of regex_match / regex_search / regex_grep / regex_format / regex_merge?
</p>
<p>
<span class="bold"><strong>A.</strong></span> These versions may or may not be available
depending upon the capabilities of your compiler, the rules determining the
format of these functions are quite complex - and only the versions visible
to a standard compliant compiler are given in the help. To find out what
your compiler supports, run &lt;boost/regex.hpp&gt; through your C++ pre-processor,
and search the output file for the function that you are interested in. Note
however, that very few current compilers still have problems with these overloaded
functions.
</p>
</div>
<table xmlns:rev="http://www.cs.rpi.edu/~gregod/boost/tools/doc/revision" width="100%"><tr>
<td align="left"></td>
<td align="right"><div class="copyright-footer">Copyright © 1998-2013 John Maddock<p>
Distributed under the Boost Software License, Version 1.0. (See accompanying
file LICENSE_1_0.txt or copy at <a href="http://www.boost.org/LICENSE_1_0.txt" target="_top">http://www.boost.org/LICENSE_1_0.txt</a>)
</p>
</div></td>
</tr></table>
<hr>
<div class="spirit-nav">
<a accesskey="p" href="futher.html"><img src="../../../../../../doc/src/images/prev.png" alt="Prev"></a><a accesskey="u" href="../background.html"><img src="../../../../../../doc/src/images/up.png" alt="Up"></a><a accesskey="h" href="../../index.html"><img src="../../../../../../doc/src/images/home.png" alt="Home"></a><a accesskey="n" href="performance.html"><img src="../../../../../../doc/src/images/next.png" alt="Next"></a>
</div>
</body>
</html>

View File

@ -0,0 +1,76 @@
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title>References and Further Information</title>
<link rel="stylesheet" href="../../../../../../doc/src/boostbook.css" type="text/css">
<meta name="generator" content="DocBook XSL Stylesheets V1.79.1">
<link rel="home" href="../../index.html" title="Boost.Regex 7.0.1">
<link rel="up" href="../background.html" title="Background Information">
<link rel="prev" href="examples.html" title="Test and Example Programs">
<link rel="next" href="faq.html" title="FAQ">
</head>
<body bgcolor="white" text="black" link="#0000FF" vlink="#840084" alink="#0000FF">
<table cellpadding="2" width="100%"><tr>
<td valign="top"><img alt="Boost C++ Libraries" width="277" height="86" src="../../../../../../boost.png"></td>
<td align="center"><a href="../../../../../../index.html">Home</a></td>
<td align="center"><a href="../../../../../../libs/libraries.htm">Libraries</a></td>
<td align="center"><a href="http://www.boost.org/users/people.html">People</a></td>
<td align="center"><a href="http://www.boost.org/users/faq.html">FAQ</a></td>
<td align="center"><a href="../../../../../../more/index.htm">More</a></td>
</tr></table>
<hr>
<div class="spirit-nav">
<a accesskey="p" href="examples.html"><img src="../../../../../../doc/src/images/prev.png" alt="Prev"></a><a accesskey="u" href="../background.html"><img src="../../../../../../doc/src/images/up.png" alt="Up"></a><a accesskey="h" href="../../index.html"><img src="../../../../../../doc/src/images/home.png" alt="Home"></a><a accesskey="n" href="faq.html"><img src="../../../../../../doc/src/images/next.png" alt="Next"></a>
</div>
<div class="section">
<div class="titlepage"><div><div><h3 class="title">
<a name="boost_regex.background.futher"></a><a class="link" href="futher.html" title="References and Further Information">References and Further
Information</a>
</h3></div></div></div>
<p>
The main Perl regular expression tutorial can be found <a href="http://perldoc.perl.org/perlretut.html" target="_top">here</a>,
there's a much shorter summary of the main features <a href="https://www.cs.tut.fi/~jkorpela/perl/regexp.html" target="_top">here</a>.
</p>
<p>
The main book on regular expressions is <a href="http://www.oreilly.com/catalog/regex/" target="_top">Mastering
Regular Expressions, published by O'Reilly</a>.
</p>
<p>
Boost.Regex forms the basis for the regular expression chapter of the <a href="http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2005/n1836.pdf" target="_top">Technical
Report on C++ Library Extensions</a>.
</p>
<p>
The <a href="http://www.opengroup.org/onlinepubs/7908799/toc.htm" target="_top">Open
Unix Specification</a> contains a wealth of useful material, including
the POSIX regular expression syntax.
</p>
<p>
The <a href="http://www.cs.ucr.edu/~stelo/pattern.html" target="_top">Pattern Matching
Pointers</a> site is a "must visit" resource for anyone interested
in pattern matching.
</p>
<p>
<a href="http://glimpse.cs.arizona.edu/" target="_top">Glimpse and Agrep</a>, use
a simplified regular expression syntax to achieve faster search times.
</p>
<p>
<a href="http://glimpse.cs.arizona.edu/udi.html" target="_top">Udi Manber</a> and
<a href="http://www.dcc.uchile.cl/~rbaeza/" target="_top">Ricardo Baeza-Yates</a>
both have a selection of useful pattern matching papers available from their
respective web sites.
</p>
</div>
<table xmlns:rev="http://www.cs.rpi.edu/~gregod/boost/tools/doc/revision" width="100%"><tr>
<td align="left"></td>
<td align="right"><div class="copyright-footer">Copyright © 1998-2013 John Maddock<p>
Distributed under the Boost Software License, Version 1.0. (See accompanying
file LICENSE_1_0.txt or copy at <a href="http://www.boost.org/LICENSE_1_0.txt" target="_top">http://www.boost.org/LICENSE_1_0.txt</a>)
</p>
</div></td>
</tr></table>
<hr>
<div class="spirit-nav">
<a accesskey="p" href="examples.html"><img src="../../../../../../doc/src/images/prev.png" alt="Prev"></a><a accesskey="u" href="../background.html"><img src="../../../../../../doc/src/images/up.png" alt="Up"></a><a accesskey="h" href="../../index.html"><img src="../../../../../../doc/src/images/home.png" alt="Home"></a><a accesskey="n" href="faq.html"><img src="../../../../../../doc/src/images/next.png" alt="Next"></a>
</div>
</body>
</html>

View File

@ -0,0 +1,54 @@
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title>Headers</title>
<link rel="stylesheet" href="../../../../../../doc/src/boostbook.css" type="text/css">
<meta name="generator" content="DocBook XSL Stylesheets V1.79.1">
<link rel="home" href="../../index.html" title="Boost.Regex 7.0.1">
<link rel="up" href="../background.html" title="Background Information">
<link rel="prev" href="../background.html" title="Background Information">
<link rel="next" href="locale.html" title="Localization">
</head>
<body bgcolor="white" text="black" link="#0000FF" vlink="#840084" alink="#0000FF">
<table cellpadding="2" width="100%"><tr>
<td valign="top"><img alt="Boost C++ Libraries" width="277" height="86" src="../../../../../../boost.png"></td>
<td align="center"><a href="../../../../../../index.html">Home</a></td>
<td align="center"><a href="../../../../../../libs/libraries.htm">Libraries</a></td>
<td align="center"><a href="http://www.boost.org/users/people.html">People</a></td>
<td align="center"><a href="http://www.boost.org/users/faq.html">FAQ</a></td>
<td align="center"><a href="../../../../../../more/index.htm">More</a></td>
</tr></table>
<hr>
<div class="spirit-nav">
<a accesskey="p" href="../background.html"><img src="../../../../../../doc/src/images/prev.png" alt="Prev"></a><a accesskey="u" href="../background.html"><img src="../../../../../../doc/src/images/up.png" alt="Up"></a><a accesskey="h" href="../../index.html"><img src="../../../../../../doc/src/images/home.png" alt="Home"></a><a accesskey="n" href="locale.html"><img src="../../../../../../doc/src/images/next.png" alt="Next"></a>
</div>
<div class="section">
<div class="titlepage"><div><div><h3 class="title">
<a name="boost_regex.background.headers"></a><a class="link" href="headers.html" title="Headers">Headers</a>
</h3></div></div></div>
<p>
There are two main headers used by this library: <code class="computeroutput"><span class="special">&lt;</span><span class="identifier">boost</span><span class="special">/</span><span class="identifier">regex</span><span class="special">.</span><span class="identifier">hpp</span><span class="special">&gt;</span></code>
provides full access to the main template library, while <code class="computeroutput"><span class="special">&lt;</span><span class="identifier">boost</span><span class="special">/</span><span class="identifier">cregex</span><span class="special">.</span><span class="identifier">hpp</span><span class="special">&gt;</span></code>
provides access to the (deprecated) high level class RegEx, and the POSIX
API functions.
</p>
<p>
There is also a header containing only forward declarations <code class="computeroutput"><span class="special">&lt;</span><span class="identifier">boost</span><span class="special">/</span><span class="identifier">regex_fwd</span><span class="special">.</span><span class="identifier">hpp</span><span class="special">&gt;</span></code>
for use when an interface is dependent upon <a class="link" href="../ref/basic_regex.html" title="basic_regex"><code class="computeroutput"><span class="identifier">basic_regex</span></code></a>, but otherwise does
not need the full definitions.
</p>
</div>
<table xmlns:rev="http://www.cs.rpi.edu/~gregod/boost/tools/doc/revision" width="100%"><tr>
<td align="left"></td>
<td align="right"><div class="copyright-footer">Copyright © 1998-2013 John Maddock<p>
Distributed under the Boost Software License, Version 1.0. (See accompanying
file LICENSE_1_0.txt or copy at <a href="http://www.boost.org/LICENSE_1_0.txt" target="_top">http://www.boost.org/LICENSE_1_0.txt</a>)
</p>
</div></td>
</tr></table>
<hr>
<div class="spirit-nav">
<a accesskey="p" href="../background.html"><img src="../../../../../../doc/src/images/prev.png" alt="Prev"></a><a accesskey="u" href="../background.html"><img src="../../../../../../doc/src/images/up.png" alt="Up"></a><a accesskey="h" href="../../index.html"><img src="../../../../../../doc/src/images/home.png" alt="Home"></a><a accesskey="n" href="locale.html"><img src="../../../../../../doc/src/images/next.png" alt="Next"></a>
</div>
</body>
</html>

View File

@ -0,0 +1,567 @@
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title>History</title>
<link rel="stylesheet" href="../../../../../../doc/src/boostbook.css" type="text/css">
<meta name="generator" content="DocBook XSL Stylesheets V1.79.1">
<link rel="home" href="../../index.html" title="Boost.Regex 7.0.1">
<link rel="up" href="../background.html" title="Background Information">
<link rel="prev" href="acknowledgements.html" title="Acknowledgements">
</head>
<body bgcolor="white" text="black" link="#0000FF" vlink="#840084" alink="#0000FF">
<table cellpadding="2" width="100%"><tr>
<td valign="top"><img alt="Boost C++ Libraries" width="277" height="86" src="../../../../../../boost.png"></td>
<td align="center"><a href="../../../../../../index.html">Home</a></td>
<td align="center"><a href="../../../../../../libs/libraries.htm">Libraries</a></td>
<td align="center"><a href="http://www.boost.org/users/people.html">People</a></td>
<td align="center"><a href="http://www.boost.org/users/faq.html">FAQ</a></td>
<td align="center"><a href="../../../../../../more/index.htm">More</a></td>
</tr></table>
<hr>
<div class="spirit-nav">
<a accesskey="p" href="acknowledgements.html"><img src="../../../../../../doc/src/images/prev.png" alt="Prev"></a><a accesskey="u" href="../background.html"><img src="../../../../../../doc/src/images/up.png" alt="Up"></a><a accesskey="h" href="../../index.html"><img src="../../../../../../doc/src/images/home.png" alt="Home"></a>
</div>
<div class="section">
<div class="titlepage"><div><div><h3 class="title">
<a name="boost_regex.background.history"></a><a class="link" href="history.html" title="History">History</a>
</h3></div></div></div>
<p>
New issues should be submitted at <a href="https://github.com/boostorg/regex/issues" target="_top">https://github.com/boostorg/regex/issues</a>
</p>
<p>
Currently open issues can be viewed <a href="https://github.com/boostorg/regex/issues?q=is%3Aopen+is%3Aissue" target="_top">here</a>.
</p>
<p>
All issues including closed ones can be viewed <a href="https://github.com/boostorg/regex/issues?q=is%3Aissue+is%3Aclosed" target="_top">here</a>.
</p>
<h5>
<a name="boost_regex.background.history.h0"></a>
<span class="phrase"><a name="boost_regex.background.history.boost_regex_7_0_1_boost_1_79_0"></a></span><a class="link" href="history.html#boost_regex.background.history.boost_regex_7_0_1_boost_1_79_0">Boost.Regex-7.0.1
(boost-1.79.0)</a>
</h5>
<div class="itemizedlist"><ul class="itemizedlist" style="list-style-type: disc; "><li class="listitem">
Minor fix for setting building with -DBOOST_REGEX_MAX_CACHE_BLOCKS=0
and <code class="computeroutput"><span class="special">&lt;</span><span class="identifier">atomic</span><span class="special">&gt;</span></code> present.
</li></ul></div>
<h5>
<a name="boost_regex.background.history.h1"></a>
<span class="phrase"><a name="boost_regex.background.history.boost_regex_7_0_0_boost_1_78_0"></a></span><a class="link" href="history.html#boost_regex.background.history.boost_regex_7_0_0_boost_1_78_0">Boost.Regex-7.0.0
(Boost-1.78.0)</a>
</h5>
<div class="itemizedlist"><ul class="itemizedlist" style="list-style-type: disc; ">
<li class="listitem">
<span class="bold"><strong>Breaking Change:</strong></span> Change \B to be the
opposite of \b as per Perl behaviour.
</li>
<li class="listitem">
Change w32_regex_traits.hpp so that windows.h is no longer included.
</li>
<li class="listitem">
Fxed fuzzing related issues <a href="https://github.com/boostorg/regex/issues/156" target="_top">#151</a>,
<a href="https://github.com/boostorg/regex/issues/156" target="_top">#152</a>,
<a href="https://github.com/boostorg/regex/issues/156" target="_top">#153</a>,
<a href="https://github.com/boostorg/regex/issues/156" target="_top">#156</a>.
</li>
</ul></div>
<h5>
<a name="boost_regex.background.history.h2"></a>
<span class="phrase"><a name="boost_regex.background.history.boost_regex_6_0_0_boost_1_77_0"></a></span><a class="link" href="history.html#boost_regex.background.history.boost_regex_6_0_0_boost_1_77_0">Boost.Regex-6.0.0
(Boost-1.77.0)</a>
</h5>
<div class="itemizedlist"><ul class="itemizedlist" style="list-style-type: disc; ">
<li class="listitem">
Big change to header only library.
</li>
<li class="listitem">
Deprecate C++03 support.
</li>
</ul></div>
<h5>
<a name="boost_regex.background.history.h3"></a>
<span class="phrase"><a name="boost_regex.background.history.boost_regex_5_1_4_boost_172_0"></a></span><a class="link" href="history.html#boost_regex.background.history.boost_regex_5_1_4_boost_172_0">Boost.Regex-5.1.4
(Boost-172.0)</a>
</h5>
<div class="itemizedlist"><ul class="itemizedlist" style="list-style-type: disc; "><li class="listitem">
Minor build fixes, see <a href="https://github.com/boostorg/regex/issues/89" target="_top">#89</a>.
</li></ul></div>
<h5>
<a name="boost_regex.background.history.h4"></a>
<span class="phrase"><a name="boost_regex.background.history.boost_regex_5_1_3_boost_1_64_0"></a></span><a class="link" href="history.html#boost_regex.background.history.boost_regex_5_1_3_boost_1_64_0">Boost.Regex-5.1.3
(Boost-1.64.0)</a>
</h5>
<div class="itemizedlist"><ul class="itemizedlist" style="list-style-type: disc; ">
<li class="listitem">
Compiling with Oracle C++ toolset is no longer restricted to static linking.
</li>
<li class="listitem">
Big effort to de-fuzz the library using libFuzzer and fix identified
issues, see: <a href="https://svn.boost.org/trac/boost/ticket/12818" target="_top">#12818</a>.
</li>
</ul></div>
<h5>
<a name="boost_regex.background.history.h5"></a>
<span class="phrase"><a name="boost_regex.background.history.boost_regex_5_1_2_boost_1_62_0"></a></span><a class="link" href="history.html#boost_regex.background.history.boost_regex_5_1_2_boost_1_62_0">Boost.Regex-5.1.2
(Boost-1.62.0)</a>
</h5>
<div class="itemizedlist"><ul class="itemizedlist" style="list-style-type: disc; ">
<li class="listitem">
Fix buffer over-run error when parsing certain invalid regexes, see
<a href="https://svn.boost.org/trac/boost/ticket/12222" target="_top">#12222</a>.
</li>
<li class="listitem">
Fix detection of ICU in library build, see <a href="https://svn.boost.org/trac/boost/ticket/12152" target="_top">#12152</a>.
</li>
<li class="listitem">
Fix bug in case sensitivity change, see <a href="https://svn.boost.org/trac/boost/ticket/11940" target="_top">#11940</a>.
</li>
<li class="listitem">
Allow types wider than int in <code class="computeroutput"><span class="special">\</span><span class="identifier">x</span><span class="special">{}</span></code>
expressions (for char32_t etc), see <a href="https://svn.boost.org/trac/boost/ticket/11988" target="_top">#11988</a>.
</li>
</ul></div>
<h5>
<a name="boost_regex.background.history.h6"></a>
<span class="phrase"><a name="boost_regex.background.history.boost_regex_5_1_1_boost_1_61_0"></a></span><a class="link" href="history.html#boost_regex.background.history.boost_regex_5_1_1_boost_1_61_0">Boost.Regex-5.1.1
(Boost-1.61.0)</a>
</h5>
<div class="itemizedlist"><ul class="itemizedlist" style="list-style-type: disc; "><li class="listitem">
Change to lockfree implementation of memory cache, see <a href="https://github.com/boostorg/regex/pull/23" target="_top">PR#23</a>.
</li></ul></div>
<h5>
<a name="boost_regex.background.history.h7"></a>
<span class="phrase"><a name="boost_regex.background.history.boost_regex_5_1_0_boost_1_60_0"></a></span><a class="link" href="history.html#boost_regex.background.history.boost_regex_5_1_0_boost_1_60_0">Boost.Regex-5.1.0
(Boost-1.60.0)</a>
</h5>
<div class="itemizedlist"><ul class="itemizedlist" style="list-style-type: disc; ">
<li class="listitem">
Add support for Perl's backtracking control verbs, see <a href="https://svn.boost.org/trac/boost/ticket/11205" target="_top">#11205</a>.
Note however, that (*MARK) and operations on marks are not currently
supported.
</li>
<li class="listitem">
Fix incorrect range end when matching [[:unicode:]], see <a href="https://svn.boost.org/trac/boost/ticket/11524" target="_top">#11524</a>.
</li>
<li class="listitem">
Change POSIX reg_comp API to not check potentially uninitialized memory,
note that code which was previously free from memory leaks (but none
the less buggy, as it didn't call reg_free) will now leak. See <a href="https://svn.boost.org/trac/boost/ticket/11472" target="_top">#11472</a>.
</li>
<li class="listitem">
Make sub_match a valid C++ range type, see <a href="https://svn.boost.org/trac/boost/ticket/11036" target="_top">#11036</a>.
</li>
</ul></div>
<h5>
<a name="boost_regex.background.history.h8"></a>
<span class="phrase"><a name="boost_regex.background.history.boost_regex_5_0_1_boost_1_58_0"></a></span><a class="link" href="history.html#boost_regex.background.history.boost_regex_5_0_1_boost_1_58_0">Boost.Regex-5.0.1
(Boost-1.58.0)</a>
</h5>
<div class="itemizedlist"><ul class="itemizedlist" style="list-style-type: disc; ">
<li class="listitem">
Fixed some typos as in <a href="https://svn.boost.org/trac/boost/ticket/10682" target="_top">#10682</a>.
</li>
<li class="listitem">
Merged <a href="https://github.com/boostorg/regex/pull/6" target="_top">pull-request
#6</a> for Coverity warnings.
</li>
<li class="listitem">
Merged <a href="https://github.com/boostorg/regex/pull/7" target="_top">pull-request
#7</a> for Coverity warnings.
</li>
<li class="listitem">
Merged <a href="https://github.com/boostorg/regex/pull/8" target="_top">pull-request
#8</a> for Coverity warnings.
</li>
<li class="listitem">
Merged <a href="https://github.com/boostorg/regex/pull/10" target="_top">pull-request
#10</a> to enable more build variants when linking to ICU.
</li>
<li class="listitem">
Fix issue with ICU and partial matches, see <a href="https://svn.boost.org/trac/boost/ticket/10114" target="_top">#10114</a>.
</li>
<li class="listitem">
Removed delayload support for the ICU libraries: this doesn't work with
the latest ICU releases (linker errors).
</li>
</ul></div>
<h5>
<a name="boost_regex.background.history.h9"></a>
<span class="phrase"><a name="boost_regex.background.history.boost_regex_5_0_0_boost_1_56_0"></a></span><a class="link" href="history.html#boost_regex.background.history.boost_regex_5_0_0_boost_1_56_0">Boost.Regex-5.0.0
(Boost-1.56.0)</a>
</h5>
<div class="itemizedlist"><ul class="itemizedlist" style="list-style-type: disc; ">
<li class="listitem">
Moved to library-specific version number post the move to Git. And since
we have one (minor) breaking change this gets bumped up from v4 to v5.
</li>
<li class="listitem">
<span class="bold"><strong>Breaking change:</strong></span> corrected behavior
of <code class="computeroutput"><span class="identifier">basic_regex</span><span class="special">&lt;&gt;::</span><span class="identifier">mark_count</span><span class="special">()</span></code>
to match existing documentation, <code class="computeroutput"><span class="identifier">basic_regex</span><span class="special">&lt;&gt;::</span><span class="identifier">subexpression</span><span class="special">(</span><span class="identifier">n</span><span class="special">)</span></code> changed to match, see <a href="https://svn.boost.org/trac/boost/ticket/9227" target="_top">#9227</a>
</li>
<li class="listitem">
Fixed issue <a href="https://svn.boost.org/trac/boost/ticket/8903" target="_top">#8903</a>.
</li>
<li class="listitem">
Fixed documentation typos from <a href="https://svn.boost.org/trac/boost/ticket/9283" target="_top">#9283</a>.
</li>
<li class="listitem">
Fixed bug in collation code that failed if the locale generated collation
strings with embedded nul's, see <a href="https://svn.boost.org/trac/boost/ticket/9451" target="_top">#9451</a>.
</li>
<li class="listitem">
Apply patch for unusual thread usage (no statically initialized mutexes),
see <a href="https://svn.boost.org/trac/boost/ticket/9461" target="_top">#9461</a>.
</li>
<li class="listitem">
Added better checks for invalid UTF-8 sequences, see <a href="https://svn.boost.org/trac/boost/ticket/9473" target="_top">#9473</a>.
</li>
</ul></div>
<h5>
<a name="boost_regex.background.history.h10"></a>
<span class="phrase"><a name="boost_regex.background.history.boost_1_54"></a></span><a class="link" href="history.html#boost_regex.background.history.boost_1_54">Boost-1.54</a>
</h5>
<p>
Fixed issue <a href="https://svn.boost.org/trac/boost/ticket/8569" target="_top">#8569</a>.
</p>
<h5>
<a name="boost_regex.background.history.h11"></a>
<span class="phrase"><a name="boost_regex.background.history.boost_1_53"></a></span><a class="link" href="history.html#boost_regex.background.history.boost_1_53">Boost-1.53</a>
</h5>
<p>
Fixed Issues: <a href="https://svn.boost.org/trac/boost/ticket/7744" target="_top">#7744</a>,
<a href="https://svn.boost.org/trac/boost/ticket/7644" target="_top">#7644</a>.
</p>
<h5>
<a name="boost_regex.background.history.h12"></a>
<span class="phrase"><a name="boost_regex.background.history.boost_1_51"></a></span><a class="link" href="history.html#boost_regex.background.history.boost_1_51">Boost-1.51</a>
</h5>
<p>
Fixed issues: <a href="https://svn.boost.org/trac/boost/ticket/589" target="_top">#589</a>,
<a href="https://svn.boost.org/trac/boost/ticket/7084" target="_top">#7084</a>,
<a href="https://svn.boost.org/trac/boost/ticket/7032" target="_top">#7032</a>,
<a href="https://svn.boost.org/trac/boost/ticket/6346" target="_top">#6346</a>.
</p>
<h5>
<a name="boost_regex.background.history.h13"></a>
<span class="phrase"><a name="boost_regex.background.history.boost_1_50"></a></span><a class="link" href="history.html#boost_regex.background.history.boost_1_50">Boost-1.50</a>
</h5>
<p>
Fixed issue with <code class="computeroutput"><span class="special">(?!)</span></code> not being
a valid expression, and updated docs on what constitutes a valid conditional
expression.
</p>
<h5>
<a name="boost_regex.background.history.h14"></a>
<span class="phrase"><a name="boost_regex.background.history.boost_1_48"></a></span><a class="link" href="history.html#boost_regex.background.history.boost_1_48">Boost-1.48</a>
</h5>
<p>
Fixed issues: <a href="https://svn.boost.org/trac/boost/ticket/688" target="_top">#698</a>,
<a href="https://svn.boost.org/trac/boost/ticket/5835" target="_top">#5835</a>,
<a href="https://svn.boost.org/trac/boost/ticket/5958" target="_top">#5958</a>,
<a href="https://svn.boost.org/trac/boost/ticket/5736" target="_top">#5736</a>.
</p>
<h5>
<a name="boost_regex.background.history.h15"></a>
<span class="phrase"><a name="boost_regex.background.history.boost_1_47"></a></span><a class="link" href="history.html#boost_regex.background.history.boost_1_47">Boost
1.47</a>
</h5>
<p>
Fixed issues: <a href="https://svn.boost.org/trac/boost/ticket/5223" target="_top">#5223</a>,
<a href="https://svn.boost.org/trac/boost/ticket/5353" target="_top">#5353</a>,
<a href="https://svn.boost.org/trac/boost/ticket/5363" target="_top">#5363</a>,
<a href="https://svn.boost.org/trac/boost/ticket/5462" target="_top">#5462</a>,
<a href="https://svn.boost.org/trac/boost/ticket/5472" target="_top">#5472</a>,
<a href="https://svn.boost.org/trac/boost/ticket/5504" target="_top">#5504</a>.
</p>
<h5>
<a name="boost_regex.background.history.h16"></a>
<span class="phrase"><a name="boost_regex.background.history.boost_1_44"></a></span><a class="link" href="history.html#boost_regex.background.history.boost_1_44">Boost
1.44</a>
</h5>
<p>
Fixed issues: <a href="https://svn.boost.org/trac/boost/ticket/4309" target="_top">#4309</a>,
<a href="https://svn.boost.org/trac/boost/ticket/4215" target="_top">#4215</a>,
<a href="https://svn.boost.org/trac/boost/ticket/4212" target="_top">#4212</a>,
<a href="https://svn.boost.org/trac/boost/ticket/4191" target="_top">#4191</a>,
<a href="https://svn.boost.org/trac/boost/ticket/4132" target="_top">#4132</a>,
<a href="https://svn.boost.org/trac/boost/ticket/4123" target="_top">#4123</a>,
<a href="https://svn.boost.org/trac/boost/ticket/4114" target="_top">#4114</a>,
<a href="https://svn.boost.org/trac/boost/ticket/4036" target="_top">#4036</a>,
<a href="https://svn.boost.org/trac/boost/ticket/4020" target="_top">#4020</a>,
<a href="https://svn.boost.org/trac/boost/ticket/3941" target="_top">#3941</a>,
<a href="https://svn.boost.org/trac/boost/ticket/3902" target="_top">#3902</a>,
<a href="https://svn.boost.org/trac/boost/ticket/3890" target="_top">#3890</a>
</p>
<h5>
<a name="boost_regex.background.history.h17"></a>
<span class="phrase"><a name="boost_regex.background.history.boost_1_42"></a></span><a class="link" href="history.html#boost_regex.background.history.boost_1_42">Boost
1.42</a>
</h5>
<div class="itemizedlist"><ul class="itemizedlist" style="list-style-type: disc; ">
<li class="listitem">
Added support for Functors rather than strings as format expressions.
</li>
<li class="listitem">
Improved error reporting when throwing exceptions to include better more
relevant information.
</li>
<li class="listitem">
Improved performance and reduced stack usage of recursive expressions.
</li>
<li class="listitem">
Fixed tickets <a href="https://svn.boost.org/trac/boost/ticket/2802" target="_top">#2802</a>,
<a href="https://svn.boost.org/trac/boost/ticket/3425" target="_top">#3425</a>,
<a href="https://svn.boost.org/trac/boost/ticket/3507" target="_top">#3507</a>,
<a href="https://svn.boost.org/trac/boost/ticket/3546" target="_top">#3546</a>,
<a href="https://svn.boost.org/trac/boost/ticket/3631" target="_top">#3631</a>,
<a href="https://svn.boost.org/trac/boost/ticket/3632" target="_top">#3632</a>,
<a href="https://svn.boost.org/trac/boost/ticket/3715" target="_top">#3715</a>,
<a href="https://svn.boost.org/trac/boost/ticket/3718" target="_top">#3718</a>,
<a href="https://svn.boost.org/trac/boost/ticket/3763" target="_top">#3763</a>,
<a href="https://svn.boost.org/trac/boost/ticket/3764" target="_top">#3764</a>
</li>
</ul></div>
<h5>
<a name="boost_regex.background.history.h18"></a>
<span class="phrase"><a name="boost_regex.background.history.boost_1_40"></a></span><a class="link" href="history.html#boost_regex.background.history.boost_1_40">Boost
1.40</a>
</h5>
<div class="itemizedlist"><ul class="itemizedlist" style="list-style-type: disc; "><li class="listitem">
Added support for many Perl 5.10 syntax elements including named sub-expressions,
branch resets and recursive regular expressions.
</li></ul></div>
<h5>
<a name="boost_regex.background.history.h19"></a>
<span class="phrase"><a name="boost_regex.background.history.boost_1_38"></a></span><a class="link" href="history.html#boost_regex.background.history.boost_1_38">Boost
1.38</a>
</h5>
<div class="itemizedlist"><ul class="itemizedlist" style="list-style-type: disc; ">
<li class="listitem">
<span class="bold"><strong>Breaking change</strong></span>: empty expressions,
and empty alternatives are now allowed when using the Perl regular expression
syntax. This change has been added for Perl compatibility, when the new
<a class="link" href="../ref/syntax_option_type.html" title="syntax_option_type"><code class="computeroutput"><span class="identifier">syntax_option_type</span></code></a>
<span class="emphasis"><em>no_empty_expressions</em></span> is set then the old behaviour
is preserved and empty expressions are prohibited. This is issue <a href="https://svn.boost.org/trac/boost/ticket/1081" target="_top">#1081</a>.
</li>
<li class="listitem">
Added support for Perl style ${n} expressions in format strings (issue
<a href="https://svn.boost.org/trac/boost/ticket/2556" target="_top">#2556</a>).
</li>
<li class="listitem">
Added support for accessing the location of sub-expressions within the
regular expression string (issue <a href="https://svn.boost.org/trac/boost/ticket/2269" target="_top">#2269</a>).
</li>
<li class="listitem">
Fixed compiler compatibility issues <a href="https://svn.boost.org/trac/boost/ticket/2244" target="_top">#2244</a>,
<a href="https://svn.boost.org/trac/boost/ticket/2514" target="_top">#2514</a>,
and <a href="https://svn.boost.org/trac/boost/ticket/2244" target="_top">#2458</a>.
</li>
</ul></div>
<h5>
<a name="boost_regex.background.history.h20"></a>
<span class="phrase"><a name="boost_regex.background.history.boost_1_34"></a></span><a class="link" href="history.html#boost_regex.background.history.boost_1_34">Boost
1.34</a>
</h5>
<div class="itemizedlist"><ul class="itemizedlist" style="list-style-type: disc; ">
<li class="listitem">
Fix for non-greedy repeats and partial matches not working correctly
in some cases.
</li>
<li class="listitem">
Fix for non-greedy repeats on VC++ not working in some cases (bug report
1515830).
</li>
<li class="listitem">
Changed match_results::position() to return a valid result when *this
represents a partial match.
</li>
<li class="listitem">
Fixed the grep and egrep options so that the newline character gets treated
the same as |.
</li>
</ul></div>
<h5>
<a name="boost_regex.background.history.h21"></a>
<span class="phrase"><a name="boost_regex.background.history.boost_1_33_1"></a></span><a class="link" href="history.html#boost_regex.background.history.boost_1_33_1">Boost
1.33.1</a>
</h5>
<div class="itemizedlist"><ul class="itemizedlist" style="list-style-type: disc; ">
<li class="listitem">
Fixed broken makefiles.
</li>
<li class="listitem">
Fixed configuration setup to allow building with VC7.1 - STLport-4.6.2
when using /Zc:wchar_t.
</li>
<li class="listitem">
Moved declarations class-inline in static_mutex.hpp so that SGI Irix
compiler can cope.
</li>
<li class="listitem">
Added needed standard library #includes to fileiter.hpp, regex_workaround.hpp
and cpp_regex_traits.hpp.
</li>
<li class="listitem">
Fixed a bug where non-greedy repeats could in certain strange circumstances
repeat more times than their maximum value.
</li>
<li class="listitem">
Fixed the value returned by basic_regex&lt;&gt;::empty() from a default
constructed object.
</li>
<li class="listitem">
Changed the definition of regex_error to make it backwards compatible
with Boost-1.32.0.
</li>
<li class="listitem">
Disabled external templates for Intel C++ 8.0 and earlier - otherwise
unresolved references can occur.
</li>
<li class="listitem">
Rewritten extern template code for gcc so that only specific member functions
are exported: otherwise strange unresolved references can occur when
linking and mixing debug and non-debug code.
</li>
<li class="listitem">
Initialise all the data members of the unicode_iterators: this keeps
gcc from issuing needless warnings.
</li>
<li class="listitem">
Ported the ICU integration code to VC6 and VC7.
</li>
<li class="listitem">
Ensured code is STLport debug mode clean.
</li>
<li class="listitem">
Fixed lookbehind assertions so that fixed length repeats are permitted,
and so that regex iteration allows lookbehind to look back before the
current search range (into the last match).
</li>
<li class="listitem">
Fixed strange bug with non-greedy repeats inside forward lookahead assertions.
</li>
<li class="listitem">
Enabled negated character classes inside character sets.
</li>
<li class="listitem">
Fixed regression so that [a-z-] is a valid expression again.
</li>
<li class="listitem">
Fixed bug that allowed some invalid expressions to be accepted.
</li>
</ul></div>
<h5>
<a name="boost_regex.background.history.h22"></a>
<span class="phrase"><a name="boost_regex.background.history.boost_1_33_0"></a></span><a class="link" href="history.html#boost_regex.background.history.boost_1_33_0">Boost
1.33.0</a>
</h5>
<div class="itemizedlist"><ul class="itemizedlist" style="list-style-type: disc; ">
<li class="listitem">
Completely rewritten expression parsing code, and traits class support;
now conforms to the standardization proposal.
</li>
<li class="listitem">
Breaking Change: The syntax options that can be passed to basic_regex
constructors have been rationalized. The default option (perl) now has
a value of zero, and it is now clearly documented which options apply
to which regular expression syntax styles (perl, POSIX-extended, POSIX-basic
etc). Some of the more esoteric options have now been removed, so there
is the possibility that existing code may fail to compile: however equivalent
functionality should still be available.
</li>
<li class="listitem">
Breaking Change: POSIX-extended and POSIX-basic regular expressions now
enforce the letter of the POSIX standard much more closely than before.
</li>
<li class="listitem">
Added support for (?imsx-imsx) constructs.
</li>
<li class="listitem">
Added support for lookbehind expressions (?&lt;=positive-lookbehind)
and (?&lt;!negative-lookbehind).
</li>
<li class="listitem">
Added support for conditional expressions (?(assertion)true-expression|false-expression).
</li>
<li class="listitem">
Added MFC/ATL string wrappers.
</li>
<li class="listitem">
Added Unicode support; based on ICU.
</li>
<li class="listitem">
Changed newline support to recognise \f as a line separator (all character
types), and \x85 as a line separator for wide characters / Unicode only.
</li>
<li class="listitem">
Added a new format flag format_literal that treats the replace string
as a literal, rather than a Perl or Sed style format string.
</li>
<li class="listitem">
Errors are now reported by throwing exceptions of type regex_error. The
types used previously - bad_expression and bad_pattern - are now just
typedefs for regex_error. Type regex_error has a couple of new members:
code() to report an error code rather than a string, and position() to
report where in the expression the error occurred.
</li>
</ul></div>
<h5>
<a name="boost_regex.background.history.h23"></a>
<span class="phrase"><a name="boost_regex.background.history.boost_1_32_1"></a></span><a class="link" href="history.html#boost_regex.background.history.boost_1_32_1">Boost
1.32.1</a>
</h5>
<div class="itemizedlist"><ul class="itemizedlist" style="list-style-type: disc; "><li class="listitem">
Fixed bug in partial matches of bounded repeats of '.'.
</li></ul></div>
<h5>
<a name="boost_regex.background.history.h24"></a>
<span class="phrase"><a name="boost_regex.background.history.boost_1_31_0"></a></span><a class="link" href="history.html#boost_regex.background.history.boost_1_31_0">Boost
1.31.0</a>
</h5>
<div class="itemizedlist"><ul class="itemizedlist" style="list-style-type: disc; ">
<li class="listitem">
Completely rewritten pattern matching code - it is now up to 10 times
faster than before.
</li>
<li class="listitem">
Reorganized documentation.
</li>
<li class="listitem">
Deprecated all interfaces that are not part of the regular expression
standardization proposal.
</li>
<li class="listitem">
Added regex_iterator and regex_token_iterator .
</li>
<li class="listitem">
Added support for Perl style independent sub-expressions.
</li>
<li class="listitem">
Added non-member operators to the sub_match class, so that you can compare
sub_match's with strings, or add them to a string to produce a new string.
</li>
<li class="listitem">
Added experimental support for extended capture information.
</li>
<li class="listitem">
Changed the match flags so that they are a distinct type (not an integer),
if you try to pass the match flags as an integer rather than match_flag_type
to the regex algorithms then you will now get a compiler error.
</li>
</ul></div>
</div>
<table xmlns:rev="http://www.cs.rpi.edu/~gregod/boost/tools/doc/revision" width="100%"><tr>
<td align="left"></td>
<td align="right"><div class="copyright-footer">Copyright © 1998-2013 John Maddock<p>
Distributed under the Boost Software License, Version 1.0. (See accompanying
file LICENSE_1_0.txt or copy at <a href="http://www.boost.org/LICENSE_1_0.txt" target="_top">http://www.boost.org/LICENSE_1_0.txt</a>)
</p>
</div></td>
</tr></table>
<hr>
<div class="spirit-nav">
<a accesskey="p" href="acknowledgements.html"><img src="../../../../../../doc/src/images/prev.png" alt="Prev"></a><a accesskey="u" href="../background.html"><img src="../../../../../../doc/src/images/up.png" alt="Up"></a><a accesskey="h" href="../../index.html"><img src="../../../../../../doc/src/images/home.png" alt="Home"></a>
</div>
</body>
</html>

File diff suppressed because it is too large Load Diff

View File

@ -0,0 +1,73 @@
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title>Performance</title>
<link rel="stylesheet" href="../../../../../../doc/src/boostbook.css" type="text/css">
<meta name="generator" content="DocBook XSL Stylesheets V1.79.1">
<link rel="home" href="../../index.html" title="Boost.Regex 7.0.1">
<link rel="up" href="../background.html" title="Background Information">
<link rel="prev" href="faq.html" title="FAQ">
<link rel="next" href="performance/section_id1378460593.html" title="Testing simple leftmost-longest matches (platform = linux, compiler = GNU C++ version 6.3.0)">
</head>
<body bgcolor="white" text="black" link="#0000FF" vlink="#840084" alink="#0000FF">
<table cellpadding="2" width="100%"><tr>
<td valign="top"><img alt="Boost C++ Libraries" width="277" height="86" src="../../../../../../boost.png"></td>
<td align="center"><a href="../../../../../../index.html">Home</a></td>
<td align="center"><a href="../../../../../../libs/libraries.htm">Libraries</a></td>
<td align="center"><a href="http://www.boost.org/users/people.html">People</a></td>
<td align="center"><a href="http://www.boost.org/users/faq.html">FAQ</a></td>
<td align="center"><a href="../../../../../../more/index.htm">More</a></td>
</tr></table>
<hr>
<div class="spirit-nav">
<a accesskey="p" href="faq.html"><img src="../../../../../../doc/src/images/prev.png" alt="Prev"></a><a accesskey="u" href="../background.html"><img src="../../../../../../doc/src/images/up.png" alt="Up"></a><a accesskey="h" href="../../index.html"><img src="../../../../../../doc/src/images/home.png" alt="Home"></a><a accesskey="n" href="performance/section_id1378460593.html"><img src="../../../../../../doc/src/images/next.png" alt="Next"></a>
</div>
<div class="section">
<div class="titlepage"><div><div><h3 class="title">
<a name="boost_regex.background.performance"></a><a class="link" href="performance.html" title="Performance">Performance</a>
</h3></div></div></div>
<div class="toc"><dl class="toc">
<dt><span class="section"><a href="performance/section_id1378460593.html">Testing
simple leftmost-longest matches (platform = linux, compiler = GNU C++ version
6.3.0)</a></span></dt>
<dt><span class="section"><a href="performance/section_id1675827111.html">Testing
Perl searches (platform = linux, compiler = GNU C++ version 6.3.0)</a></span></dt>
<dt><span class="section"><a href="performance/section_id3141719723.html">Testing
simple leftmost-longest matches (platform = Windows x64, compiler = Microsoft
Visual C++ version 14.1)</a></span></dt>
<dt><span class="section"><a href="performance/section_id3258595385.html">Testing
leftmost-longest searches (platform = Windows x64, compiler = Microsoft Visual
C++ version 14.1)</a></span></dt>
<dt><span class="section"><a href="performance/section_id3261825021.html">Testing
simple Perl matches (platform = linux, compiler = GNU C++ version 6.3.0)</a></span></dt>
<dt><span class="section"><a href="performance/section_id3752650613.html">Testing
Perl searches (platform = Windows x64, compiler = Microsoft Visual C++ version
14.1)</a></span></dt>
<dt><span class="section"><a href="performance/section_id4128344975.html">Testing
simple Perl matches (platform = Windows x64, compiler = Microsoft Visual
C++ version 14.1)</a></span></dt>
<dt><span class="section"><a href="performance/section_id4148872883.html">Testing
leftmost-longest searches (platform = linux, compiler = GNU C++ version 6.3.0)</a></span></dt>
</dl></div>
<p>
The performance of Boost.Regex in both recursive and non-recursive modes
should be broadly comparable to other regular expression libraries: recursive
mode is slightly faster (especially where memory allocation requires thread
synchronisation), but not by much. The following pages compare Boost.Regex
with various other regular expression libraries for the following compilers:
</p>
</div>
<table xmlns:rev="http://www.cs.rpi.edu/~gregod/boost/tools/doc/revision" width="100%"><tr>
<td align="left"></td>
<td align="right"><div class="copyright-footer">Copyright © 1998-2013 John Maddock<p>
Distributed under the Boost Software License, Version 1.0. (See accompanying
file LICENSE_1_0.txt or copy at <a href="http://www.boost.org/LICENSE_1_0.txt" target="_top">http://www.boost.org/LICENSE_1_0.txt</a>)
</p>
</div></td>
</tr></table>
<hr>
<div class="spirit-nav">
<a accesskey="p" href="faq.html"><img src="../../../../../../doc/src/images/prev.png" alt="Prev"></a><a accesskey="u" href="../background.html"><img src="../../../../../../doc/src/images/up.png" alt="Up"></a><a accesskey="h" href="../../index.html"><img src="../../../../../../doc/src/images/home.png" alt="Home"></a><a accesskey="n" href="performance/section_id1378460593.html"><img src="../../../../../../doc/src/images/next.png" alt="Next"></a>
</div>
</body>
</html>

View File

@ -0,0 +1,404 @@
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title>Testing simple leftmost-longest matches (platform = linux, compiler = GNU C++ version 6.3.0)</title>
<link rel="stylesheet" href="../../../../../../../doc/src/boostbook.css" type="text/css">
<meta name="generator" content="DocBook XSL Stylesheets V1.79.1">
<link rel="home" href="../../../index.html" title="Boost.Regex 7.0.1">
<link rel="up" href="../performance.html" title="Performance">
<link rel="prev" href="../performance.html" title="Performance">
<link rel="next" href="section_id1675827111.html" title="Testing Perl searches (platform = linux, compiler = GNU C++ version 6.3.0)">
</head>
<body bgcolor="white" text="black" link="#0000FF" vlink="#840084" alink="#0000FF">
<table cellpadding="2" width="100%"><tr>
<td valign="top"><img alt="Boost C++ Libraries" width="277" height="86" src="../../../../../../../boost.png"></td>
<td align="center"><a href="../../../../../../../index.html">Home</a></td>
<td align="center"><a href="../../../../../../../libs/libraries.htm">Libraries</a></td>
<td align="center"><a href="http://www.boost.org/users/people.html">People</a></td>
<td align="center"><a href="http://www.boost.org/users/faq.html">FAQ</a></td>
<td align="center"><a href="../../../../../../../more/index.htm">More</a></td>
</tr></table>
<hr>
<div class="spirit-nav">
<a accesskey="p" href="../performance.html"><img src="../../../../../../../doc/src/images/prev.png" alt="Prev"></a><a accesskey="u" href="../performance.html"><img src="../../../../../../../doc/src/images/up.png" alt="Up"></a><a accesskey="h" href="../../../index.html"><img src="../../../../../../../doc/src/images/home.png" alt="Home"></a><a accesskey="n" href="section_id1675827111.html"><img src="../../../../../../../doc/src/images/next.png" alt="Next"></a>
</div>
<div class="section">
<div class="titlepage"><div><div><h4 class="title">
<a name="boost_regex.background.performance.section_id1378460593"></a><a class="link" href="section_id1378460593.html" title="Testing simple leftmost-longest matches (platform = linux, compiler = GNU C++ version 6.3.0)">Testing
simple leftmost-longest matches (platform = linux, compiler = GNU C++ version
6.3.0)</a>
</h4></div></div></div>
<div class="table">
<a name="boost_regex.background.performance.section_id1378460593.table_Testing_simple_leftmost_longest_matches_platform_linux_compiler_GNU_C_version_6_3_0_"></a><p class="title"><b>Table 8. Testing simple leftmost-longest matches (platform = linux, compiler
= GNU C++ version 6.3.0)</b></p>
<div class="table-contents"><table class="table" summary="Testing simple leftmost-longest matches (platform = linux, compiler
= GNU C++ version 6.3.0)">
<colgroup>
<col>
<col>
<col>
<col>
</colgroup>
<thead><tr>
<th>
<p>
Expression<br> Text
</p>
</th>
<th>
<p>
boost 1.65
</p>
</th>
<th>
<p>
std::regex
</p>
</th>
<th>
<p>
POSIX
</p>
</th>
</tr></thead>
<tbody>
<tr>
<td>
<p>
<code class="literal">([[:digit:]]{4}[- ]){3}[[:digit:]]{3,4}</code><br>
<code class="literal">1234-5678-1234-456</code>
</p>
</td>
<td>
<p>
<span class="green">1.11<br> (669ns)</span>
</p>
</td>
<td>
<p>
<span class="green">1.00<br> (603ns)</span>
</p>
</td>
<td>
<p>
<span class="blue">3.70<br> (2234ns)</span>
</p>
</td>
</tr>
<tr>
<td>
<p>
<code class="literal">^([0-9]+)(\-| |$)(.*)$</code><br> <code class="literal">100-
this is a line of ftp response which contains a message string</code>
</p>
</td>
<td>
<p>
<span class="green">1.00<br> (781ns)</span>
</p>
</td>
<td>
<p>
<span class="red">4.52<br> (3530ns)</span>
</p>
</td>
<td>
<p>
<span class="red">12.72<br> (9933ns)</span>
</p>
</td>
</tr>
<tr>
<td>
<p>
<code class="literal">^([a-zA-Z0-9_\-\.]+)@((\[[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\.)|(([a-zA-Z0-9\-]+\.)+))([a-zA-Z]{2,4}|[0-9]{1,3})(\
...</code><br> <code class="literal">bob.smith@foo.tv</code>
</p>
</td>
<td>
<p>
<span class="green">1.00<br> (937ns)</span>
</p>
</td>
<td>
<p>
<span class="blue">1.26<br> (1184ns)</span>
</p>
</td>
<td>
<p>
<span class="blue">3.06<br> (2864ns)</span>
</p>
</td>
</tr>
<tr>
<td>
<p>
<code class="literal">^([a-zA-Z0-9_\-\.]+)@((\[[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\.)|(([a-zA-Z0-9\-]+\.)+))([a-zA-Z]{2,4}|[0-9]{1,3})(\
...</code><br> <code class="literal">foo12@foo.edu</code>
</p>
</td>
<td>
<p>
<span class="green">1.00<br> (892ns)</span>
</p>
</td>
<td>
<p>
<span class="blue">1.29<br> (1150ns)</span>
</p>
</td>
<td>
<p>
<span class="blue">2.95<br> (2628ns)</span>
</p>
</td>
</tr>
<tr>
<td>
<p>
<code class="literal">^([a-zA-Z0-9_\-\.]+)@((\[[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\.)|(([a-zA-Z0-9\-]+\.)+))([a-zA-Z]{2,4}|[0-9]{1,3})(\
...</code><br> <code class="literal">john@johnmaddock.co.uk</code>
</p>
</td>
<td>
<p>
<span class="green">1.00<br> (1160ns)</span>
</p>
</td>
<td>
<p>
<span class="blue">1.31<br> (1517ns)</span>
</p>
</td>
<td>
<p>
<span class="blue">3.29<br> (3818ns)</span>
</p>
</td>
</tr>
<tr>
<td>
<p>
<code class="literal">^[-+]?[[:digit:]]*\.?[[:digit:]]*$</code><br>
<code class="literal">+3.14159</code>
</p>
</td>
<td>
<p>
<span class="blue">1.58<br> (485ns)</span>
</p>
</td>
<td>
<p>
<span class="blue">1.48<br> (455ns)</span>
</p>
</td>
<td>
<p>
<span class="green">1.00<br> (307ns)</span>
</p>
</td>
</tr>
<tr>
<td>
<p>
<code class="literal">^[-+]?[[:digit:]]*\.?[[:digit:]]*$</code><br>
<code class="literal">-3.14159</code>
</p>
</td>
<td>
<p>
<span class="blue">1.50<br> (466ns)</span>
</p>
</td>
<td>
<p>
<span class="blue">1.50<br> (464ns)</span>
</p>
</td>
<td>
<p>
<span class="green">1.00<br> (310ns)</span>
</p>
</td>
</tr>
<tr>
<td>
<p>
<code class="literal">^[-+]?[[:digit:]]*\.?[[:digit:]]*$</code><br>
<code class="literal">123</code>
</p>
</td>
<td>
<p>
<span class="blue">3.10<br> (666ns)</span>
</p>
</td>
<td>
<p>
<span class="blue">1.57<br> (338ns)</span>
</p>
</td>
<td>
<p>
<span class="green">1.00<br> (215ns)</span>
</p>
</td>
</tr>
<tr>
<td>
<p>
<code class="literal">^[[:digit:]]{1,2}/[[:digit:]]{1,2}/[[:digit:]]{4}$</code><br>
<code class="literal">12/12/2001</code>
</p>
</td>
<td>
<p>
<span class="blue">2.18<br> (373ns)</span>
</p>
</td>
<td>
<p>
<span class="blue">2.10<br> (359ns)</span>
</p>
</td>
<td>
<p>
<span class="green">1.00<br> (171ns)</span>
</p>
</td>
</tr>
<tr>
<td>
<p>
<code class="literal">^[[:digit:]]{1,2}/[[:digit:]]{1,2}/[[:digit:]]{4}$</code><br>
<code class="literal">4/1/2001</code>
</p>
</td>
<td>
<p>
<span class="blue">2.27<br> (363ns)</span>
</p>
</td>
<td>
<p>
<span class="blue">1.93<br> (309ns)</span>
</p>
</td>
<td>
<p>
<span class="green">1.00<br> (160ns)</span>
</p>
</td>
</tr>
<tr>
<td>
<p>
<code class="literal">^[a-zA-Z]{1,2}[0-9][0-9A-Za-z]{0,1} {0,1}[0-9][A-Za-z]{2}$</code><br>
<code class="literal">EH10 2QQ</code>
</p>
</td>
<td>
<p>
<span class="blue">2.90<br> (473ns)</span>
</p>
</td>
<td>
<p>
<span class="blue">2.19<br> (357ns)</span>
</p>
</td>
<td>
<p>
<span class="green">1.00<br> (163ns)</span>
</p>
</td>
</tr>
<tr>
<td>
<p>
<code class="literal">^[a-zA-Z]{1,2}[0-9][0-9A-Za-z]{0,1} {0,1}[0-9][A-Za-z]{2}$</code><br>
<code class="literal">G1 1AA</code>
</p>
</td>
<td>
<p>
<span class="blue">2.56<br> (386ns)</span>
</p>
</td>
<td>
<p>
<span class="blue">1.83<br> (277ns)</span>
</p>
</td>
<td>
<p>
<span class="green">1.00<br> (151ns)</span>
</p>
</td>
</tr>
<tr>
<td>
<p>
<code class="literal">^[a-zA-Z]{1,2}[0-9][0-9A-Za-z]{0,1} {0,1}[0-9][A-Za-z]{2}$</code><br>
<code class="literal">SW1 1ZZ</code>
</p>
</td>
<td>
<p>
<span class="blue">2.46<br> (381ns)</span>
</p>
</td>
<td>
<p>
<span class="blue">2.14<br> (331ns)</span>
</p>
</td>
<td>
<p>
<span class="green">1.00<br> (155ns)</span>
</p>
</td>
</tr>
<tr>
<td>
<p>
<code class="literal">abc</code><br> <code class="literal">abc</code>
</p>
</td>
<td>
<p>
<span class="blue">2.35<br> (324ns)</span>
</p>
</td>
<td>
<p>
<span class="green">1.11<br> (153ns)</span>
</p>
</td>
<td>
<p>
<span class="green">1.00<br> (138ns)</span>
</p>
</td>
</tr>
</tbody>
</table></div>
</div>
<br class="table-break">
</div>
<table xmlns:rev="http://www.cs.rpi.edu/~gregod/boost/tools/doc/revision" width="100%"><tr>
<td align="left"></td>
<td align="right"><div class="copyright-footer">Copyright © 1998-2013 John Maddock<p>
Distributed under the Boost Software License, Version 1.0. (See accompanying
file LICENSE_1_0.txt or copy at <a href="http://www.boost.org/LICENSE_1_0.txt" target="_top">http://www.boost.org/LICENSE_1_0.txt</a>)
</p>
</div></td>
</tr></table>
<hr>
<div class="spirit-nav">
<a accesskey="p" href="../performance.html"><img src="../../../../../../../doc/src/images/prev.png" alt="Prev"></a><a accesskey="u" href="../performance.html"><img src="../../../../../../../doc/src/images/up.png" alt="Up"></a><a accesskey="h" href="../../../index.html"><img src="../../../../../../../doc/src/images/home.png" alt="Home"></a><a accesskey="n" href="section_id1675827111.html"><img src="../../../../../../../doc/src/images/next.png" alt="Next"></a>
</div>
</body>
</html>

View File

@ -0,0 +1,451 @@
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title>Testing Perl searches (platform = linux, compiler = GNU C++ version 6.3.0)</title>
<link rel="stylesheet" href="../../../../../../../doc/src/boostbook.css" type="text/css">
<meta name="generator" content="DocBook XSL Stylesheets V1.79.1">
<link rel="home" href="../../../index.html" title="Boost.Regex 7.0.1">
<link rel="up" href="../performance.html" title="Performance">
<link rel="prev" href="section_id1378460593.html" title="Testing simple leftmost-longest matches (platform = linux, compiler = GNU C++ version 6.3.0)">
<link rel="next" href="section_id3141719723.html" title="Testing simple leftmost-longest matches (platform = Windows x64, compiler = Microsoft Visual C++ version 14.1)">
</head>
<body bgcolor="white" text="black" link="#0000FF" vlink="#840084" alink="#0000FF">
<table cellpadding="2" width="100%"><tr>
<td valign="top"><img alt="Boost C++ Libraries" width="277" height="86" src="../../../../../../../boost.png"></td>
<td align="center"><a href="../../../../../../../index.html">Home</a></td>
<td align="center"><a href="../../../../../../../libs/libraries.htm">Libraries</a></td>
<td align="center"><a href="http://www.boost.org/users/people.html">People</a></td>
<td align="center"><a href="http://www.boost.org/users/faq.html">FAQ</a></td>
<td align="center"><a href="../../../../../../../more/index.htm">More</a></td>
</tr></table>
<hr>
<div class="spirit-nav">
<a accesskey="p" href="section_id1378460593.html"><img src="../../../../../../../doc/src/images/prev.png" alt="Prev"></a><a accesskey="u" href="../performance.html"><img src="../../../../../../../doc/src/images/up.png" alt="Up"></a><a accesskey="h" href="../../../index.html"><img src="../../../../../../../doc/src/images/home.png" alt="Home"></a><a accesskey="n" href="section_id3141719723.html"><img src="../../../../../../../doc/src/images/next.png" alt="Next"></a>
</div>
<div class="section">
<div class="titlepage"><div><div><h4 class="title">
<a name="boost_regex.background.performance.section_id1675827111"></a><a class="link" href="section_id1675827111.html" title="Testing Perl searches (platform = linux, compiler = GNU C++ version 6.3.0)">Testing
Perl searches (platform = linux, compiler = GNU C++ version 6.3.0)</a>
</h4></div></div></div>
<div class="table">
<a name="boost_regex.background.performance.section_id1675827111.table_Testing_Perl_searches_platform_linux_compiler_GNU_C_version_6_3_0_"></a><p class="title"><b>Table 9. Testing Perl searches (platform = linux, compiler = GNU C++ version
6.3.0)</b></p>
<div class="table-contents"><table class="table" summary="Testing Perl searches (platform = linux, compiler = GNU C++ version
6.3.0)">
<colgroup>
<col>
<col>
<col>
<col>
<col>
</colgroup>
<thead><tr>
<th>
<p>
Expression<br> Text
</p>
</th>
<th>
<p>
boost 1.65
</p>
</th>
<th>
<p>
std::regex
</p>
</th>
<th>
<p>
boost::xpressive::cregex
</p>
</th>
<th>
<p>
PCRE-10.21
</p>
</th>
</tr></thead>
<tbody>
<tr>
<td>
<p>
<code class="literal">(?i)&lt;a[^&gt;]+href=("[^"]*"|[^[:space:]]+)[^&gt;]*&gt;</code><br>
In file: ..<span class="emphasis"><em>..</em></span>../libs/libraries.htm
</p>
</td>
<td>
<p>
<span class="blue">1.63<br> (28838ns)</span>
</p>
</td>
<td>
<p>
<span class="grey">-</span>
</p>
</td>
<td>
<p>
<span class="blue">1.67<br> (29436ns)</span>
</p>
</td>
<td>
<p>
<span class="green">1.00<br> (17678ns)</span>
</p>
</td>
</tr>
<tr>
<td>
<p>
<code class="literal">(?i)&lt;font[^&gt;]+face=("[^"]*"|[^[:space:]]+)[^&gt;]*&gt;.*?&lt;/font&gt;</code><br>
In file: ..<span class="emphasis"><em>..</em></span>../libs/libraries.htm
</p>
</td>
<td>
<p>
<span class="blue">2.78<br> (19366ns)</span>
</p>
</td>
<td>
<p>
<span class="grey">-</span>
</p>
</td>
<td>
<p>
<span class="blue">1.50<br> (10471ns)</span>
</p>
</td>
<td>
<p>
<span class="green">1.00<br> (6963ns)</span>
</p>
</td>
</tr>
<tr>
<td>
<p>
<code class="literal">(?i)&lt;h[12345678][^&gt;]*&gt;.*?&lt;/h[12345678]&gt;</code><br>
In file: ..<span class="emphasis"><em>..</em></span>../libs/libraries.htm
</p>
</td>
<td>
<p>
<span class="blue">1.95<br> (17081ns)</span>
</p>
</td>
<td>
<p>
<span class="grey">-</span>
</p>
</td>
<td>
<p>
<span class="blue">2.18<br> (19086ns)</span>
</p>
</td>
<td>
<p>
<span class="green">1.00<br> (8745ns)</span>
</p>
</td>
</tr>
<tr>
<td>
<p>
<code class="literal">(?i)&lt;img[^&gt;]+src=("[^"]*"|[^[:space:]]+)[^&gt;]*&gt;</code><br>
In file: ..<span class="emphasis"><em>..</em></span>../libs/libraries.htm
</p>
</td>
<td>
<p>
<span class="blue">2.61<br> (18132ns)</span>
</p>
</td>
<td>
<p>
<span class="grey">-</span>
</p>
</td>
<td>
<p>
<span class="blue">1.61<br> (11211ns)</span>
</p>
</td>
<td>
<p>
<span class="green">1.00<br> (6952ns)</span>
</p>
</td>
</tr>
<tr>
<td>
<p>
<code class="literal">(?i)&lt;p&gt;.*?&lt;/p&gt;</code><br> In file:
..<span class="emphasis"><em>..</em></span>../libs/libraries.htm
</p>
</td>
<td>
<p>
<span class="blue">1.69<br> (17517ns)</span>
</p>
</td>
<td>
<p>
<span class="grey">-</span>
</p>
</td>
<td>
<p>
<span class="blue">1.51<br> (15645ns)</span>
</p>
</td>
<td>
<p>
<span class="green">1.00<br> (10345ns)</span>
</p>
</td>
</tr>
<tr>
<td>
<p>
<code class="literal">(\w+)\s*(\([^()]++(?:(?2)[^()]++)*+[^)]*\))\s*(\{[^{}]++((?3)[^{}]++)*+[^}]*+\})</code><br>
In file: boost/multiprecision/number.hpp
</p>
</td>
<td>
<p>
<span class="green">1.00<br> (1500580ns)</span>
</p>
</td>
<td>
<p>
<span class="grey">-</span>
</p>
</td>
<td>
<p>
<span class="grey">-</span>
</p>
</td>
<td>
<p>
<span class="blue">2.84<br> (4260530ns)</span>
</p>
</td>
</tr>
<tr>
<td>
<p>
<code class="literal">(^[ \t]*#(?:(?&gt;[^\\\n]+)|\\(?&gt;\s*\n|.))*)|</code><br>
In file: boost/multiprecision/number.hpp
</p>
</td>
<td>
<p>
<span class="blue">1.64<br> (14163004ns)</span>
</p>
</td>
<td>
<p>
<span class="grey">-</span>
</p>
</td>
<td>
<p>
<span class="green">1.00<br> (8632111ns)</span>
</p>
</td>
<td>
<p>
<span class="green">1.03<br> (8907897ns)</span>
</p>
</td>
</tr>
<tr>
<td>
<p>
<code class="literal">(template[[:space:]]*&lt;[^;:{]+&gt;[[:space:]]*)?(class|struct)[[:space:]]*(\w+([
]*\([^)]*\))?[\u0 ...</code><br> In file: boost/multiprecision/number.hpp
</p>
</td>
<td>
<p>
<span class="blue">1.72<br> (13046296ns)</span>
</p>
</td>
<td>
<p>
<span class="blue">3.61<br> (27370747ns)</span>
</p>
</td>
<td>
<p>
<span class="green">1.00<br> (7585304ns)</span>
</p>
</td>
<td>
<p>
<span class="blue">1.98<br> (14992880ns)</span>
</p>
</td>
</tr>
<tr>
<td>
<p>
<code class="literal">Beman|John|Dave</code><br> In file: ..<span class="emphasis"><em>..</em></span>../libs/libraries.htm
</p>
</td>
<td>
<p>
<span class="green">1.00<br> (5021ns)</span>
</p>
</td>
<td>
<p>
<span class="red">36.75<br> (184532ns)</span>
</p>
</td>
<td>
<p>
<span class="blue">1.40<br> (7046ns)</span>
</p>
</td>
<td>
<p>
<span class="green">1.19<br> (5966ns)</span>
</p>
</td>
</tr>
<tr>
<td>
<p>
<code class="literal">\w+\s*(\([^()]++(?:(?1)[^()]++)*+[^)]*\))</code><br>
In file: boost/multiprecision/number.hpp
</p>
</td>
<td>
<p>
<span class="green">1.00<br> (1551419ns)</span>
</p>
</td>
<td>
<p>
<span class="grey">-</span>
</p>
</td>
<td>
<p>
<span class="grey">-</span>
</p>
</td>
<td>
<p>
<span class="blue">1.58<br> (2444759ns)</span>
</p>
</td>
</tr>
<tr>
<td>
<p>
<code class="literal">\{[^{}]++((?0)[^{}]++)*+[^}]*+\}</code><br> In
file: boost/multiprecision/number.hpp
</p>
</td>
<td>
<p>
<span class="blue">1.31<br> (200846ns)</span>
</p>
</td>
<td>
<p>
<span class="grey">-</span>
</p>
</td>
<td>
<p>
<span class="grey">-</span>
</p>
</td>
<td>
<p>
<span class="green">1.00<br> (153117ns)</span>
</p>
</td>
</tr>
<tr>
<td>
<p>
<code class="literal">^[ ]*#[ ]*include[ ]+("[^"]+"|&lt;[^&gt;]+&gt;)</code><br>
In file: boost/multiprecision/number.hpp
</p>
</td>
<td>
<p>
<span class="blue">1.46<br> (234901ns)</span>
</p>
</td>
<td>
<p>
<span class="red">11.35<br> (1821532ns)</span>
</p>
</td>
<td>
<p>
<span class="green">1.00<br> (160446ns)</span>
</p>
</td>
<td>
<p>
<span class="blue">1.35<br> (215802ns)</span>
</p>
</td>
</tr>
<tr>
<td>
<p>
<code class="literal">^[ ]*#[ ]*include[ ]+("boost/[^"]+"|&lt;boost/[^&gt;]+&gt;)</code><br>
In file: boost/multiprecision/number.hpp
</p>
</td>
<td>
<p>
<span class="blue">1.41<br> (234377ns)</span>
</p>
</td>
<td>
<p>
<span class="red">11.47<br> (1903901ns)</span>
</p>
</td>
<td>
<p>
<span class="green">1.00<br> (165921ns)</span>
</p>
</td>
<td>
<p>
<span class="blue">1.31<br> (217806ns)</span>
</p>
</td>
</tr>
</tbody>
</table></div>
</div>
<br class="table-break">
</div>
<table xmlns:rev="http://www.cs.rpi.edu/~gregod/boost/tools/doc/revision" width="100%"><tr>
<td align="left"></td>
<td align="right"><div class="copyright-footer">Copyright © 1998-2013 John Maddock<p>
Distributed under the Boost Software License, Version 1.0. (See accompanying
file LICENSE_1_0.txt or copy at <a href="http://www.boost.org/LICENSE_1_0.txt" target="_top">http://www.boost.org/LICENSE_1_0.txt</a>)
</p>
</div></td>
</tr></table>
<hr>
<div class="spirit-nav">
<a accesskey="p" href="section_id1378460593.html"><img src="../../../../../../../doc/src/images/prev.png" alt="Prev"></a><a accesskey="u" href="../performance.html"><img src="../../../../../../../doc/src/images/up.png" alt="Up"></a><a accesskey="h" href="../../../index.html"><img src="../../../../../../../doc/src/images/home.png" alt="Home"></a><a accesskey="n" href="section_id3141719723.html"><img src="../../../../../../../doc/src/images/next.png" alt="Next"></a>
</div>
</body>
</html>

View File

@ -0,0 +1,328 @@
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title>Testing simple leftmost-longest matches (platform = Windows x64, compiler = Microsoft Visual C++ version 14.1)</title>
<link rel="stylesheet" href="../../../../../../../doc/src/boostbook.css" type="text/css">
<meta name="generator" content="DocBook XSL Stylesheets V1.79.1">
<link rel="home" href="../../../index.html" title="Boost.Regex 7.0.1">
<link rel="up" href="../performance.html" title="Performance">
<link rel="prev" href="section_id1675827111.html" title="Testing Perl searches (platform = linux, compiler = GNU C++ version 6.3.0)">
<link rel="next" href="section_id3258595385.html" title="Testing leftmost-longest searches (platform = Windows x64, compiler = Microsoft Visual C++ version 14.1)">
</head>
<body bgcolor="white" text="black" link="#0000FF" vlink="#840084" alink="#0000FF">
<table cellpadding="2" width="100%"><tr>
<td valign="top"><img alt="Boost C++ Libraries" width="277" height="86" src="../../../../../../../boost.png"></td>
<td align="center"><a href="../../../../../../../index.html">Home</a></td>
<td align="center"><a href="../../../../../../../libs/libraries.htm">Libraries</a></td>
<td align="center"><a href="http://www.boost.org/users/people.html">People</a></td>
<td align="center"><a href="http://www.boost.org/users/faq.html">FAQ</a></td>
<td align="center"><a href="../../../../../../../more/index.htm">More</a></td>
</tr></table>
<hr>
<div class="spirit-nav">
<a accesskey="p" href="section_id1675827111.html"><img src="../../../../../../../doc/src/images/prev.png" alt="Prev"></a><a accesskey="u" href="../performance.html"><img src="../../../../../../../doc/src/images/up.png" alt="Up"></a><a accesskey="h" href="../../../index.html"><img src="../../../../../../../doc/src/images/home.png" alt="Home"></a><a accesskey="n" href="section_id3258595385.html"><img src="../../../../../../../doc/src/images/next.png" alt="Next"></a>
</div>
<div class="section">
<div class="titlepage"><div><div><h4 class="title">
<a name="boost_regex.background.performance.section_id3141719723"></a><a class="link" href="section_id3141719723.html" title="Testing simple leftmost-longest matches (platform = Windows x64, compiler = Microsoft Visual C++ version 14.1)">Testing
simple leftmost-longest matches (platform = Windows x64, compiler = Microsoft
Visual C++ version 14.1)</a>
</h4></div></div></div>
<div class="table">
<a name="boost_regex.background.performance.section_id3141719723.table_Testing_simple_leftmost_longest_matches_platform_Windows_x64_compiler_Microsoft_Visual_C_version_14_1_"></a><p class="title"><b>Table 10. Testing simple leftmost-longest matches (platform = Windows x64,
compiler = Microsoft Visual C++ version 14.1)</b></p>
<div class="table-contents"><table class="table" summary="Testing simple leftmost-longest matches (platform = Windows x64,
compiler = Microsoft Visual C++ version 14.1)">
<colgroup>
<col>
<col>
<col>
</colgroup>
<thead><tr>
<th>
<p>
Expression<br> Text
</p>
</th>
<th>
<p>
boost 1.65
</p>
</th>
<th>
<p>
std::regex
</p>
</th>
</tr></thead>
<tbody>
<tr>
<td>
<p>
<code class="literal">([[:digit:]]{4}[- ]){3}[[:digit:]]{3,4}</code><br>
<code class="literal">1234-5678-1234-456</code>
</p>
</td>
<td>
<p>
<span class="green">1.00<br> (554ns)</span>
</p>
</td>
<td>
<p>
<span class="red">11.06<br> (6127ns)</span>
</p>
</td>
</tr>
<tr>
<td>
<p>
<code class="literal">^([0-9]+)(\-| |$)(.*)$</code><br> <code class="literal">100-
this is a line of ftp response which contains a message string</code>
</p>
</td>
<td>
<p>
<span class="green">1.00<br> (679ns)</span>
</p>
</td>
<td>
<p>
<span class="grey">-</span>
</p>
</td>
</tr>
<tr>
<td>
<p>
<code class="literal">^([a-zA-Z0-9_\-\.]+)@((\[[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\.)|(([a-zA-Z0-9\-]+\.)+))([a-zA-Z]{2,4}|[0-9]{1,3})(\
...</code><br> <code class="literal">bob.smith@foo.tv</code>
</p>
</td>
<td>
<p>
<span class="green">1.00<br> (1444ns)</span>
</p>
</td>
<td>
<p>
<span class="grey">-</span>
</p>
</td>
</tr>
<tr>
<td>
<p>
<code class="literal">^([a-zA-Z0-9_\-\.]+)@((\[[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\.)|(([a-zA-Z0-9\-]+\.)+))([a-zA-Z]{2,4}|[0-9]{1,3})(\
...</code><br> <code class="literal">foo12@foo.edu</code>
</p>
</td>
<td>
<p>
<span class="green">1.00<br> (1397ns)</span>
</p>
</td>
<td>
<p>
<span class="grey">-</span>
</p>
</td>
</tr>
<tr>
<td>
<p>
<code class="literal">^([a-zA-Z0-9_\-\.]+)@((\[[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\.)|(([a-zA-Z0-9\-]+\.)+))([a-zA-Z]{2,4}|[0-9]{1,3})(\
...</code><br> <code class="literal">john@johnmaddock.co.uk</code>
</p>
</td>
<td>
<p>
<span class="green">1.00<br> (1588ns)</span>
</p>
</td>
<td>
<p>
<span class="grey">-</span>
</p>
</td>
</tr>
<tr>
<td>
<p>
<code class="literal">^[-+]?[[:digit:]]*\.?[[:digit:]]*$</code><br>
<code class="literal">+3.14159</code>
</p>
</td>
<td>
<p>
<span class="green">1.00<br> (466ns)</span>
</p>
</td>
<td>
<p>
<span class="red">11.18<br> (5208ns)</span>
</p>
</td>
</tr>
<tr>
<td>
<p>
<code class="literal">^[-+]?[[:digit:]]*\.?[[:digit:]]*$</code><br>
<code class="literal">-3.14159</code>
</p>
</td>
<td>
<p>
<span class="green">1.00<br> (519ns)</span>
</p>
</td>
<td>
<p>
<span class="red">9.79<br> (5083ns)</span>
</p>
</td>
</tr>
<tr>
<td>
<p>
<code class="literal">^[-+]?[[:digit:]]*\.?[[:digit:]]*$</code><br>
<code class="literal">123</code>
</p>
</td>
<td>
<p>
<span class="green">1.00<br> (619ns)</span>
</p>
</td>
<td>
<p>
<span class="red">7.64<br> (4730ns)</span>
</p>
</td>
</tr>
<tr>
<td>
<p>
<code class="literal">^[[:digit:]]{1,2}/[[:digit:]]{1,2}/[[:digit:]]{4}$</code><br>
<code class="literal">12/12/2001</code>
</p>
</td>
<td>
<p>
<span class="green">1.00<br> (449ns)</span>
</p>
</td>
<td>
<p>
<span class="red">5.23<br> (2347ns)</span>
</p>
</td>
</tr>
<tr>
<td>
<p>
<code class="literal">^[[:digit:]]{1,2}/[[:digit:]]{1,2}/[[:digit:]]{4}$</code><br>
<code class="literal">4/1/2001</code>
</p>
</td>
<td>
<p>
<span class="green">1.00<br> (362ns)</span>
</p>
</td>
<td>
<p>
<span class="red">6.48<br> (2344ns)</span>
</p>
</td>
</tr>
<tr>
<td>
<p>
<code class="literal">^[a-zA-Z]{1,2}[0-9][0-9A-Za-z]{0,1} {0,1}[0-9][A-Za-z]{2}$</code><br>
<code class="literal">EH10 2QQ</code>
</p>
</td>
<td>
<p>
<span class="green">1.00<br> (1090ns)</span>
</p>
</td>
<td>
<p>
<span class="blue">2.48<br> (2699ns)</span>
</p>
</td>
</tr>
<tr>
<td>
<p>
<code class="literal">^[a-zA-Z]{1,2}[0-9][0-9A-Za-z]{0,1} {0,1}[0-9][A-Za-z]{2}$</code><br>
<code class="literal">G1 1AA</code>
</p>
</td>
<td>
<p>
<span class="green">1.00<br> (348ns)</span>
</p>
</td>
<td>
<p>
<span class="red">6.57<br> (2288ns)</span>
</p>
</td>
</tr>
<tr>
<td>
<p>
<code class="literal">^[a-zA-Z]{1,2}[0-9][0-9A-Za-z]{0,1} {0,1}[0-9][A-Za-z]{2}$</code><br>
<code class="literal">SW1 1ZZ</code>
</p>
</td>
<td>
<p>
<span class="green">1.00<br> (358ns)</span>
</p>
</td>
<td>
<p>
<span class="red">6.41<br> (2296ns)</span>
</p>
</td>
</tr>
<tr>
<td>
<p>
<code class="literal">abc</code><br> <code class="literal">abc</code>
</p>
</td>
<td>
<p>
<span class="green">1.00<br> (375ns)</span>
</p>
</td>
<td>
<p>
<span class="blue">2.30<br> (864ns)</span>
</p>
</td>
</tr>
</tbody>
</table></div>
</div>
<br class="table-break">
</div>
<table xmlns:rev="http://www.cs.rpi.edu/~gregod/boost/tools/doc/revision" width="100%"><tr>
<td align="left"></td>
<td align="right"><div class="copyright-footer">Copyright © 1998-2013 John Maddock<p>
Distributed under the Boost Software License, Version 1.0. (See accompanying
file LICENSE_1_0.txt or copy at <a href="http://www.boost.org/LICENSE_1_0.txt" target="_top">http://www.boost.org/LICENSE_1_0.txt</a>)
</p>
</div></td>
</tr></table>
<hr>
<div class="spirit-nav">
<a accesskey="p" href="section_id1675827111.html"><img src="../../../../../../../doc/src/images/prev.png" alt="Prev"></a><a accesskey="u" href="../performance.html"><img src="../../../../../../../doc/src/images/up.png" alt="Up"></a><a accesskey="h" href="../../../index.html"><img src="../../../../../../../doc/src/images/home.png" alt="Home"></a><a accesskey="n" href="section_id3258595385.html"><img src="../../../../../../../doc/src/images/next.png" alt="Next"></a>
</div>
</body>
</html>

View File

@ -0,0 +1,130 @@
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title>Testing leftmost-longest searches (platform = Windows x64, compiler = Microsoft Visual C++ version 14.1)</title>
<link rel="stylesheet" href="../../../../../../../doc/src/boostbook.css" type="text/css">
<meta name="generator" content="DocBook XSL Stylesheets V1.79.1">
<link rel="home" href="../../../index.html" title="Boost.Regex 7.0.1">
<link rel="up" href="../performance.html" title="Performance">
<link rel="prev" href="section_id3141719723.html" title="Testing simple leftmost-longest matches (platform = Windows x64, compiler = Microsoft Visual C++ version 14.1)">
<link rel="next" href="section_id3261825021.html" title="Testing simple Perl matches (platform = linux, compiler = GNU C++ version 6.3.0)">
</head>
<body bgcolor="white" text="black" link="#0000FF" vlink="#840084" alink="#0000FF">
<table cellpadding="2" width="100%"><tr>
<td valign="top"><img alt="Boost C++ Libraries" width="277" height="86" src="../../../../../../../boost.png"></td>
<td align="center"><a href="../../../../../../../index.html">Home</a></td>
<td align="center"><a href="../../../../../../../libs/libraries.htm">Libraries</a></td>
<td align="center"><a href="http://www.boost.org/users/people.html">People</a></td>
<td align="center"><a href="http://www.boost.org/users/faq.html">FAQ</a></td>
<td align="center"><a href="../../../../../../../more/index.htm">More</a></td>
</tr></table>
<hr>
<div class="spirit-nav">
<a accesskey="p" href="section_id3141719723.html"><img src="../../../../../../../doc/src/images/prev.png" alt="Prev"></a><a accesskey="u" href="../performance.html"><img src="../../../../../../../doc/src/images/up.png" alt="Up"></a><a accesskey="h" href="../../../index.html"><img src="../../../../../../../doc/src/images/home.png" alt="Home"></a><a accesskey="n" href="section_id3261825021.html"><img src="../../../../../../../doc/src/images/next.png" alt="Next"></a>
</div>
<div class="section">
<div class="titlepage"><div><div><h4 class="title">
<a name="boost_regex.background.performance.section_id3258595385"></a><a class="link" href="section_id3258595385.html" title="Testing leftmost-longest searches (platform = Windows x64, compiler = Microsoft Visual C++ version 14.1)">Testing
leftmost-longest searches (platform = Windows x64, compiler = Microsoft Visual
C++ version 14.1)</a>
</h4></div></div></div>
<div class="table">
<a name="boost_regex.background.performance.section_id3258595385.table_Testing_leftmost_longest_searches_platform_Windows_x64_compiler_Microsoft_Visual_C_version_14_1_"></a><p class="title"><b>Table 11. Testing leftmost-longest searches (platform = Windows x64, compiler
= Microsoft Visual C++ version 14.1)</b></p>
<div class="table-contents"><table class="table" summary="Testing leftmost-longest searches (platform = Windows x64, compiler
= Microsoft Visual C++ version 14.1)">
<colgroup>
<col>
<col>
<col>
</colgroup>
<thead><tr>
<th>
<p>
Expression<br> Text
</p>
</th>
<th>
<p>
boost 1.65
</p>
</th>
<th>
<p>
std::regex
</p>
</th>
</tr></thead>
<tbody>
<tr>
<td>
<p>
<code class="literal">&lt;a[^&gt;]+href=("[^"]*"|[^[:space:]]+)[^&gt;]*&gt;</code><br>
In file: ..<span class="emphasis"><em>..</em></span>../libs/libraries.htm
</p>
</td>
<td>
<p>
<span class="green">1.00<br> (80801ns)</span>
</p>
</td>
<td>
<p>
<span class="red">6.82<br> (551022ns)</span>
</p>
</td>
</tr>
<tr>
<td>
<p>
<code class="literal">&lt;img[^&gt;]+src=("[^"]*"|[^[:space:]]+)[^&gt;]*&gt;</code><br>
In file: ..<span class="emphasis"><em>..</em></span>../libs/libraries.htm
</p>
</td>
<td>
<p>
<span class="green">1.00<br> (19868ns)</span>
</p>
</td>
<td>
<p>
<span class="red">4.23<br> (84068ns)</span>
</p>
</td>
</tr>
<tr>
<td>
<p>
<code class="literal">Beman|John|Dave</code><br> In file: ..<span class="emphasis"><em>..</em></span>../libs/libraries.htm
</p>
</td>
<td>
<p>
<span class="green">1.00<br> (10508ns)</span>
</p>
</td>
<td>
<p>
<span class="blue">3.37<br> (35378ns)</span>
</p>
</td>
</tr>
</tbody>
</table></div>
</div>
<br class="table-break">
</div>
<table xmlns:rev="http://www.cs.rpi.edu/~gregod/boost/tools/doc/revision" width="100%"><tr>
<td align="left"></td>
<td align="right"><div class="copyright-footer">Copyright © 1998-2013 John Maddock<p>
Distributed under the Boost Software License, Version 1.0. (See accompanying
file LICENSE_1_0.txt or copy at <a href="http://www.boost.org/LICENSE_1_0.txt" target="_top">http://www.boost.org/LICENSE_1_0.txt</a>)
</p>
</div></td>
</tr></table>
<hr>
<div class="spirit-nav">
<a accesskey="p" href="section_id3141719723.html"><img src="../../../../../../../doc/src/images/prev.png" alt="Prev"></a><a accesskey="u" href="../performance.html"><img src="../../../../../../../doc/src/images/up.png" alt="Up"></a><a accesskey="h" href="../../../index.html"><img src="../../../../../../../doc/src/images/home.png" alt="Home"></a><a accesskey="n" href="section_id3261825021.html"><img src="../../../../../../../doc/src/images/next.png" alt="Next"></a>
</div>
</body>
</html>

View File

@ -0,0 +1,479 @@
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title>Testing simple Perl matches (platform = linux, compiler = GNU C++ version 6.3.0)</title>
<link rel="stylesheet" href="../../../../../../../doc/src/boostbook.css" type="text/css">
<meta name="generator" content="DocBook XSL Stylesheets V1.79.1">
<link rel="home" href="../../../index.html" title="Boost.Regex 7.0.1">
<link rel="up" href="../performance.html" title="Performance">
<link rel="prev" href="section_id3258595385.html" title="Testing leftmost-longest searches (platform = Windows x64, compiler = Microsoft Visual C++ version 14.1)">
<link rel="next" href="section_id3752650613.html" title="Testing Perl searches (platform = Windows x64, compiler = Microsoft Visual C++ version 14.1)">
</head>
<body bgcolor="white" text="black" link="#0000FF" vlink="#840084" alink="#0000FF">
<table cellpadding="2" width="100%"><tr>
<td valign="top"><img alt="Boost C++ Libraries" width="277" height="86" src="../../../../../../../boost.png"></td>
<td align="center"><a href="../../../../../../../index.html">Home</a></td>
<td align="center"><a href="../../../../../../../libs/libraries.htm">Libraries</a></td>
<td align="center"><a href="http://www.boost.org/users/people.html">People</a></td>
<td align="center"><a href="http://www.boost.org/users/faq.html">FAQ</a></td>
<td align="center"><a href="../../../../../../../more/index.htm">More</a></td>
</tr></table>
<hr>
<div class="spirit-nav">
<a accesskey="p" href="section_id3258595385.html"><img src="../../../../../../../doc/src/images/prev.png" alt="Prev"></a><a accesskey="u" href="../performance.html"><img src="../../../../../../../doc/src/images/up.png" alt="Up"></a><a accesskey="h" href="../../../index.html"><img src="../../../../../../../doc/src/images/home.png" alt="Home"></a><a accesskey="n" href="section_id3752650613.html"><img src="../../../../../../../doc/src/images/next.png" alt="Next"></a>
</div>
<div class="section">
<div class="titlepage"><div><div><h4 class="title">
<a name="boost_regex.background.performance.section_id3261825021"></a><a class="link" href="section_id3261825021.html" title="Testing simple Perl matches (platform = linux, compiler = GNU C++ version 6.3.0)">Testing
simple Perl matches (platform = linux, compiler = GNU C++ version 6.3.0)</a>
</h4></div></div></div>
<div class="table">
<a name="boost_regex.background.performance.section_id3261825021.table_Testing_simple_Perl_matches_platform_linux_compiler_GNU_C_version_6_3_0_"></a><p class="title"><b>Table 12. Testing simple Perl matches (platform = linux, compiler = GNU C++
version 6.3.0)</b></p>
<div class="table-contents"><table class="table" summary="Testing simple Perl matches (platform = linux, compiler = GNU C++
version 6.3.0)">
<colgroup>
<col>
<col>
<col>
<col>
<col>
</colgroup>
<thead><tr>
<th>
<p>
Expression<br> Text
</p>
</th>
<th>
<p>
boost 1.65
</p>
</th>
<th>
<p>
std::regex
</p>
</th>
<th>
<p>
boost::xpressive::cregex
</p>
</th>
<th>
<p>
PCRE-10.21
</p>
</th>
</tr></thead>
<tbody>
<tr>
<td>
<p>
<code class="literal">([[:digit:]]{4}[- ]){3}[[:digit:]]{3,4}</code><br>
<code class="literal">1234-5678-1234-456</code>
</p>
</td>
<td>
<p>
<span class="blue">2.65<br> (506ns)</span>
</p>
</td>
<td>
<p>
<span class="blue">2.86<br> (546ns)</span>
</p>
</td>
<td>
<p>
<span class="green">1.00<br> (191ns)</span>
</p>
</td>
<td>
<p>
<span class="blue">1.37<br> (262ns)</span>
</p>
</td>
</tr>
<tr>
<td>
<p>
<code class="literal">^([0-9]+)(\-| |$)(.*)$</code><br> <code class="literal">100-
this is a line of ftp response which contains a message string</code>
</p>
</td>
<td>
<p>
<span class="blue">2.52<br> (353ns)</span>
</p>
</td>
<td>
<p>
<span class="red">20.99<br> (2939ns)</span>
</p>
</td>
<td>
<p>
<span class="green">1.00<br> (140ns)</span>
</p>
</td>
<td>
<p>
<span class="blue">3.50<br> (490ns)</span>
</p>
</td>
</tr>
<tr>
<td>
<p>
<code class="literal">^([a-zA-Z0-9_\-\.]+)@((\[[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\.)|(([a-zA-Z0-9\-]+\.)+))([a-zA-Z]{2,4}|[0-9]{1,3})(\
...</code><br> <code class="literal">bob.smith@foo.tv</code>
</p>
</td>
<td>
<p>
<span class="blue">1.98<br> (681ns)</span>
</p>
</td>
<td>
<p>
<span class="grey">-</span>
</p>
</td>
<td>
<p>
<span class="green">1.00<br> (344ns)</span>
</p>
</td>
<td>
<p>
<span class="blue">1.32<br> (454ns)</span>
</p>
</td>
</tr>
<tr>
<td>
<p>
<code class="literal">^([a-zA-Z0-9_\-\.]+)@((\[[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\.)|(([a-zA-Z0-9\-]+\.)+))([a-zA-Z]{2,4}|[0-9]{1,3})(\
...</code><br> <code class="literal">foo12@foo.edu</code>
</p>
</td>
<td>
<p>
<span class="blue">2.06<br> (695ns)</span>
</p>
</td>
<td>
<p>
<span class="grey">-</span>
</p>
</td>
<td>
<p>
<span class="green">1.00<br> (337ns)</span>
</p>
</td>
<td>
<p>
<span class="blue">1.34<br> (451ns)</span>
</p>
</td>
</tr>
<tr>
<td>
<p>
<code class="literal">^([a-zA-Z0-9_\-\.]+)@((\[[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\.)|(([a-zA-Z0-9\-]+\.)+))([a-zA-Z]{2,4}|[0-9]{1,3})(\
...</code><br> <code class="literal">john@johnmaddock.co.uk</code>
</p>
</td>
<td>
<p>
<span class="blue">1.93<br> (821ns)</span>
</p>
</td>
<td>
<p>
<span class="grey">-</span>
</p>
</td>
<td>
<p>
<span class="green">1.00<br> (425ns)</span>
</p>
</td>
<td>
<p>
<span class="blue">1.24<br> (526ns)</span>
</p>
</td>
</tr>
<tr>
<td>
<p>
<code class="literal">^[-+]?[[:digit:]]*\.?[[:digit:]]*$</code><br>
<code class="literal">+3.14159</code>
</p>
</td>
<td>
<p>
<span class="blue">2.34<br> (243ns)</span>
</p>
</td>
<td>
<p>
<span class="red">4.45<br> (463ns)</span>
</p>
</td>
<td>
<p>
<span class="green">1.00<br> (104ns)</span>
</p>
</td>
<td>
<p>
<span class="blue">1.62<br> (168ns)</span>
</p>
</td>
</tr>
<tr>
<td>
<p>
<code class="literal">^[-+]?[[:digit:]]*\.?[[:digit:]]*$</code><br>
<code class="literal">-3.14159</code>
</p>
</td>
<td>
<p>
<span class="blue">2.33<br> (245ns)</span>
</p>
</td>
<td>
<p>
<span class="red">4.39<br> (461ns)</span>
</p>
</td>
<td>
<p>
<span class="green">1.00<br> (105ns)</span>
</p>
</td>
<td>
<p>
<span class="blue">1.60<br> (168ns)</span>
</p>
</td>
</tr>
<tr>
<td>
<p>
<code class="literal">^[-+]?[[:digit:]]*\.?[[:digit:]]*$</code><br>
<code class="literal">123</code>
</p>
</td>
<td>
<p>
<span class="blue">2.08<br> (208ns)</span>
</p>
</td>
<td>
<p>
<span class="blue">3.31<br> (331ns)</span>
</p>
</td>
<td>
<p>
<span class="green">1.00<br> (100ns)</span>
</p>
</td>
<td>
<p>
<span class="blue">1.52<br> (152ns)</span>
</p>
</td>
</tr>
<tr>
<td>
<p>
<code class="literal">^[[:digit:]]{1,2}/[[:digit:]]{1,2}/[[:digit:]]{4}$</code><br>
<code class="literal">12/12/2001</code>
</p>
</td>
<td>
<p>
<span class="blue">2.28<br> (237ns)</span>
</p>
</td>
<td>
<p>
<span class="blue">3.39<br> (353ns)</span>
</p>
</td>
<td>
<p>
<span class="green">1.00<br> (104ns)</span>
</p>
</td>
<td>
<p>
<span class="green">1.18<br> (123ns)</span>
</p>
</td>
</tr>
<tr>
<td>
<p>
<code class="literal">^[[:digit:]]{1,2}/[[:digit:]]{1,2}/[[:digit:]]{4}$</code><br>
<code class="literal">4/1/2001</code>
</p>
</td>
<td>
<p>
<span class="blue">2.12<br> (216ns)</span>
</p>
</td>
<td>
<p>
<span class="blue">3.02<br> (308ns)</span>
</p>
</td>
<td>
<p>
<span class="green">1.00<br> (102ns)</span>
</p>
</td>
<td>
<p>
<span class="green">1.19<br> (121ns)</span>
</p>
</td>
</tr>
<tr>
<td>
<p>
<code class="literal">^[a-zA-Z]{1,2}[0-9][0-9A-Za-z]{0,1} {0,1}[0-9][A-Za-z]{2}$</code><br>
<code class="literal">EH10 2QQ</code>
</p>
</td>
<td>
<p>
<span class="blue">2.12<br> (257ns)</span>
</p>
</td>
<td>
<p>
<span class="blue">2.66<br> (322ns)</span>
</p>
</td>
<td>
<p>
<span class="green">1.00<br> (121ns)</span>
</p>
</td>
<td>
<p>
<span class="green">1.17<br> (142ns)</span>
</p>
</td>
</tr>
<tr>
<td>
<p>
<code class="literal">^[a-zA-Z]{1,2}[0-9][0-9A-Za-z]{0,1} {0,1}[0-9][A-Za-z]{2}$</code><br>
<code class="literal">G1 1AA</code>
</p>
</td>
<td>
<p>
<span class="blue">2.00<br> (230ns)</span>
</p>
</td>
<td>
<p>
<span class="blue">2.65<br> (305ns)</span>
</p>
</td>
<td>
<p>
<span class="green">1.00<br> (115ns)</span>
</p>
</td>
<td>
<p>
<span class="blue">1.22<br> (140ns)</span>
</p>
</td>
</tr>
<tr>
<td>
<p>
<code class="literal">^[a-zA-Z]{1,2}[0-9][0-9A-Za-z]{0,1} {0,1}[0-9][A-Za-z]{2}$</code><br>
<code class="literal">SW1 1ZZ</code>
</p>
</td>
<td>
<p>
<span class="blue">2.05<br> (244ns)</span>
</p>
</td>
<td>
<p>
<span class="blue">2.81<br> (334ns)</span>
</p>
</td>
<td>
<p>
<span class="green">1.00<br> (119ns)</span>
</p>
</td>
<td>
<p>
<span class="blue">1.22<br> (145ns)</span>
</p>
</td>
</tr>
<tr>
<td>
<p>
<code class="literal">abc</code><br> <code class="literal">abc</code>
</p>
</td>
<td>
<p>
<span class="blue">1.65<br> (135ns)</span>
</p>
</td>
<td>
<p>
<span class="blue">1.83<br> (150ns)</span>
</p>
</td>
<td>
<p>
<span class="green">1.00<br> (82ns)</span>
</p>
</td>
<td>
<p>
<span class="green">1.02<br> (84ns)</span>
</p>
</td>
</tr>
</tbody>
</table></div>
</div>
<br class="table-break">
</div>
<table xmlns:rev="http://www.cs.rpi.edu/~gregod/boost/tools/doc/revision" width="100%"><tr>
<td align="left"></td>
<td align="right"><div class="copyright-footer">Copyright © 1998-2013 John Maddock<p>
Distributed under the Boost Software License, Version 1.0. (See accompanying
file LICENSE_1_0.txt or copy at <a href="http://www.boost.org/LICENSE_1_0.txt" target="_top">http://www.boost.org/LICENSE_1_0.txt</a>)
</p>
</div></td>
</tr></table>
<hr>
<div class="spirit-nav">
<a accesskey="p" href="section_id3258595385.html"><img src="../../../../../../../doc/src/images/prev.png" alt="Prev"></a><a accesskey="u" href="../performance.html"><img src="../../../../../../../doc/src/images/up.png" alt="Up"></a><a accesskey="h" href="../../../index.html"><img src="../../../../../../../doc/src/images/home.png" alt="Home"></a><a accesskey="n" href="section_id3752650613.html"><img src="../../../../../../../doc/src/images/next.png" alt="Next"></a>
</div>
</body>
</html>

View File

@ -0,0 +1,523 @@
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title>Testing Perl searches (platform = Windows x64, compiler = Microsoft Visual C++ version 14.1)</title>
<link rel="stylesheet" href="../../../../../../../doc/src/boostbook.css" type="text/css">
<meta name="generator" content="DocBook XSL Stylesheets V1.79.1">
<link rel="home" href="../../../index.html" title="Boost.Regex 7.0.1">
<link rel="up" href="../performance.html" title="Performance">
<link rel="prev" href="section_id3261825021.html" title="Testing simple Perl matches (platform = linux, compiler = GNU C++ version 6.3.0)">
<link rel="next" href="section_id4128344975.html" title="Testing simple Perl matches (platform = Windows x64, compiler = Microsoft Visual C++ version 14.1)">
</head>
<body bgcolor="white" text="black" link="#0000FF" vlink="#840084" alink="#0000FF">
<table cellpadding="2" width="100%"><tr>
<td valign="top"><img alt="Boost C++ Libraries" width="277" height="86" src="../../../../../../../boost.png"></td>
<td align="center"><a href="../../../../../../../index.html">Home</a></td>
<td align="center"><a href="../../../../../../../libs/libraries.htm">Libraries</a></td>
<td align="center"><a href="http://www.boost.org/users/people.html">People</a></td>
<td align="center"><a href="http://www.boost.org/users/faq.html">FAQ</a></td>
<td align="center"><a href="../../../../../../../more/index.htm">More</a></td>
</tr></table>
<hr>
<div class="spirit-nav">
<a accesskey="p" href="section_id3261825021.html"><img src="../../../../../../../doc/src/images/prev.png" alt="Prev"></a><a accesskey="u" href="../performance.html"><img src="../../../../../../../doc/src/images/up.png" alt="Up"></a><a accesskey="h" href="../../../index.html"><img src="../../../../../../../doc/src/images/home.png" alt="Home"></a><a accesskey="n" href="section_id4128344975.html"><img src="../../../../../../../doc/src/images/next.png" alt="Next"></a>
</div>
<div class="section">
<div class="titlepage"><div><div><h4 class="title">
<a name="boost_regex.background.performance.section_id3752650613"></a><a class="link" href="section_id3752650613.html" title="Testing Perl searches (platform = Windows x64, compiler = Microsoft Visual C++ version 14.1)">Testing
Perl searches (platform = Windows x64, compiler = Microsoft Visual C++ version
14.1)</a>
</h4></div></div></div>
<div class="table">
<a name="boost_regex.background.performance.section_id3752650613.table_Testing_Perl_searches_platform_Windows_x64_compiler_Microsoft_Visual_C_version_14_1_"></a><p class="title"><b>Table 13. Testing Perl searches (platform = Windows x64, compiler = Microsoft
Visual C++ version 14.1)</b></p>
<div class="table-contents"><table class="table" summary="Testing Perl searches (platform = Windows x64, compiler = Microsoft
Visual C++ version 14.1)">
<colgroup>
<col>
<col>
<col>
<col>
<col>
<col>
</colgroup>
<thead><tr>
<th>
<p>
Expression<br> Text
</p>
</th>
<th>
<p>
boost 1.65
</p>
</th>
<th>
<p>
PCRE-10.10
</p>
</th>
<th>
<p>
RE2
</p>
</th>
<th>
<p>
std::regex
</p>
</th>
<th>
<p>
boost::xpressive::cregex
</p>
</th>
</tr></thead>
<tbody>
<tr>
<td>
<p>
<code class="literal">(?i)&lt;a[^&gt;]+href=("[^"]*"|[^[:space:]]+)[^&gt;]*&gt;</code><br>
In file: ..<span class="emphasis"><em>..</em></span>../libs/libraries.htm
</p>
</td>
<td>
<p>
<span class="blue">1.36<br> (21565ns)</span>
</p>
</td>
<td>
<p>
<span class="green">1.00<br> (15821ns)</span>
</p>
</td>
<td>
<p>
<span class="green">1.08<br> (17111ns)</span>
</p>
</td>
<td>
<p>
<span class="grey">-</span>
</p>
</td>
<td>
<p>
<span class="blue">2.89<br> (45731ns)</span>
</p>
</td>
</tr>
<tr>
<td>
<p>
<code class="literal">(?i)&lt;font[^&gt;]+face=("[^"]*"|[^[:space:]]+)[^&gt;]*&gt;.*?&lt;/font&gt;</code><br>
In file: ..<span class="emphasis"><em>..</em></span>../libs/libraries.htm
</p>
</td>
<td>
<p>
<span class="blue">3.05<br> (16442ns)</span>
</p>
</td>
<td>
<p>
<span class="blue">1.58<br> (8492ns)</span>
</p>
</td>
<td>
<p>
<span class="green">1.00<br> (5385ns)</span>
</p>
</td>
<td>
<p>
<span class="grey">-</span>
</p>
</td>
<td>
<p>
<span class="blue">3.31<br> (17804ns)</span>
</p>
</td>
</tr>
<tr>
<td>
<p>
<code class="literal">(?i)&lt;h[12345678][^&gt;]*&gt;.*?&lt;/h[12345678]&gt;</code><br>
In file: ..<span class="emphasis"><em>..</em></span>../libs/libraries.htm
</p>
</td>
<td>
<p>
<span class="blue">2.11<br> (15434ns)</span>
</p>
</td>
<td>
<p>
<span class="blue">1.31<br> (9615ns)</span>
</p>
</td>
<td>
<p>
<span class="green">1.00<br> (7315ns)</span>
</p>
</td>
<td>
<p>
<span class="grey">-</span>
</p>
</td>
<td>
<p>
<span class="red">4.28<br> (31331ns)</span>
</p>
</td>
</tr>
<tr>
<td>
<p>
<code class="literal">(?i)&lt;img[^&gt;]+src=("[^"]*"|[^[:space:]]+)[^&gt;]*&gt;</code><br>
In file: ..<span class="emphasis"><em>..</em></span>../libs/libraries.htm
</p>
</td>
<td>
<p>
<span class="blue">2.73<br> (16457ns)</span>
</p>
</td>
<td>
<p>
<span class="blue">1.41<br> (8503ns)</span>
</p>
</td>
<td>
<p>
<span class="green">1.00<br> (6023ns)</span>
</p>
</td>
<td>
<p>
<span class="grey">-</span>
</p>
</td>
<td>
<p>
<span class="blue">3.14<br> (18913ns)</span>
</p>
</td>
</tr>
<tr>
<td>
<p>
<code class="literal">(?i)&lt;p&gt;.*?&lt;/p&gt;</code><br> In file:
..<span class="emphasis"><em>..</em></span>../libs/libraries.htm
</p>
</td>
<td>
<p>
<span class="blue">2.32<br> (15717ns)</span>
</p>
</td>
<td>
<p>
<span class="blue">1.57<br> (10652ns)</span>
</p>
</td>
<td>
<p>
<span class="green">1.00<br> (6789ns)</span>
</p>
</td>
<td>
<p>
<span class="grey">-</span>
</p>
</td>
<td>
<p>
<span class="blue">3.76<br> (25542ns)</span>
</p>
</td>
</tr>
<tr>
<td>
<p>
<code class="literal">(\w+)\s*(\([^()]++(?:(?2)[^()]++)*+[^)]*\))\s*(\{[^{}]++((?3)[^{}]++)*+[^}]*+\})</code><br>
In file: boost/multiprecision/number.hpp
</p>
</td>
<td>
<p>
<span class="green">1.00<br> (1125008ns)</span>
</p>
</td>
<td>
<p>
<span class="blue">2.90<br> (3265708ns)</span>
</p>
</td>
<td>
<p>
<span class="grey">-</span>
</p>
</td>
<td>
<p>
<span class="grey">-</span>
</p>
</td>
<td>
<p>
<span class="grey">-</span>
</p>
</td>
</tr>
<tr>
<td>
<p>
<code class="literal">(^[ \t]*#(?:(?&gt;[^\\\n]+)|\\(?&gt;\s*\n|.))*)|</code><br>
In file: boost/multiprecision/number.hpp
</p>
</td>
<td>
<p>
<span class="blue">1.55<br> (11035845ns)</span>
</p>
</td>
<td>
<p>
<span class="green">1.00<br> (7123895ns)</span>
</p>
</td>
<td>
<p>
<span class="grey">-</span>
</p>
</td>
<td>
<p>
<span class="grey">-</span>
</p>
</td>
<td>
<p>
<span class="blue">1.46<br> (10415180ns)</span>
</p>
</td>
</tr>
<tr>
<td>
<p>
<code class="literal">(template[[:space:]]*&lt;[^;:{]+&gt;[[:space:]]*)?(class|struct)[[:space:]]*(\w+([
]*\([^)]*\))?[\u0 ...</code><br> In file: boost/multiprecision/number.hpp
</p>
</td>
<td>
<p>
<span class="red">26.17<br> (8436744ns)</span>
</p>
</td>
<td>
<p>
<span class="red">32.97<br> (10629852ns)</span>
</p>
</td>
<td>
<p>
<span class="green">1.00<br> (322399ns)</span>
</p>
</td>
<td>
<p>
<span class="red">811.84<br> (261737971ns)</span>
</p>
</td>
<td>
<p>
<span class="red">23.34<br> (7526351ns)</span>
</p>
</td>
</tr>
<tr>
<td>
<p>
<code class="literal">Beman|John|Dave</code><br> In file: ..<span class="emphasis"><em>..</em></span>../libs/libraries.htm
</p>
</td>
<td>
<p>
<span class="blue">1.58<br> (10246ns)</span>
</p>
</td>
<td>
<p>
<span class="green">1.00<br> (6487ns)</span>
</p>
</td>
<td>
<p>
<span class="blue">2.48<br> (16109ns)</span>
</p>
</td>
<td>
<p>
<span class="red">5.39<br> (34994ns)</span>
</p>
</td>
<td>
<p>
<span class="green">1.09<br> (7046ns)</span>
</p>
</td>
</tr>
<tr>
<td>
<p>
<code class="literal">\w+\s*(\([^()]++(?:(?1)[^()]++)*+[^)]*\))</code><br>
In file: boost/multiprecision/number.hpp
</p>
</td>
<td>
<p>
<span class="green">1.00<br> (1152646ns)</span>
</p>
</td>
<td>
<p>
<span class="blue">1.70<br> (1962067ns)</span>
</p>
</td>
<td>
<p>
<span class="grey">-</span>
</p>
</td>
<td>
<p>
<span class="grey">-</span>
</p>
</td>
<td>
<p>
<span class="grey">-</span>
</p>
</td>
</tr>
<tr>
<td>
<p>
<code class="literal">\{[^{}]++((?0)[^{}]++)*+[^}]*+\}</code><br> In
file: boost/multiprecision/number.hpp
</p>
</td>
<td>
<p>
<span class="blue">1.62<br> (255439ns)</span>
</p>
</td>
<td>
<p>
<span class="green">1.00<br> (158034ns)</span>
</p>
</td>
<td>
<p>
<span class="grey">-</span>
</p>
</td>
<td>
<p>
<span class="grey">-</span>
</p>
</td>
<td>
<p>
<span class="grey">-</span>
</p>
</td>
</tr>
<tr>
<td>
<p>
<code class="literal">^[ ]*#[ ]*include[ ]+("[^"]+"|&lt;[^&gt;]+&gt;)</code><br>
In file: boost/multiprecision/number.hpp
</p>
</td>
<td>
<p>
<span class="blue">1.48<br> (268270ns)</span>
</p>
</td>
<td>
<p>
<span class="green">1.08<br> (195553ns)</span>
</p>
</td>
<td>
<p>
<span class="blue">1.78<br> (323879ns)</span>
</p>
</td>
<td>
<p>
<span class="red">7.75<br> (1406976ns)</span>
</p>
</td>
<td>
<p>
<span class="green">1.00<br> (181554ns)</span>
</p>
</td>
</tr>
<tr>
<td>
<p>
<code class="literal">^[ ]*#[ ]*include[ ]+("boost/[^"]+"|&lt;boost/[^&gt;]+&gt;)</code><br>
In file: boost/multiprecision/number.hpp
</p>
</td>
<td>
<p>
<span class="blue">1.48<br> (268560ns)</span>
</p>
</td>
<td>
<p>
<span class="green">1.08<br> (195915ns)</span>
</p>
</td>
<td>
<p>
<span class="blue">1.76<br> (319886ns)</span>
</p>
</td>
<td>
<p>
<span class="red">7.72<br> (1398962ns)</span>
</p>
</td>
<td>
<p>
<span class="green">1.00<br> (181328ns)</span>
</p>
</td>
</tr>
</tbody>
</table></div>
</div>
<br class="table-break">
</div>
<table xmlns:rev="http://www.cs.rpi.edu/~gregod/boost/tools/doc/revision" width="100%"><tr>
<td align="left"></td>
<td align="right"><div class="copyright-footer">Copyright © 1998-2013 John Maddock<p>
Distributed under the Boost Software License, Version 1.0. (See accompanying
file LICENSE_1_0.txt or copy at <a href="http://www.boost.org/LICENSE_1_0.txt" target="_top">http://www.boost.org/LICENSE_1_0.txt</a>)
</p>
</div></td>
</tr></table>
<hr>
<div class="spirit-nav">
<a accesskey="p" href="section_id3261825021.html"><img src="../../../../../../../doc/src/images/prev.png" alt="Prev"></a><a accesskey="u" href="../performance.html"><img src="../../../../../../../doc/src/images/up.png" alt="Up"></a><a accesskey="h" href="../../../index.html"><img src="../../../../../../../doc/src/images/home.png" alt="Home"></a><a accesskey="n" href="section_id4128344975.html"><img src="../../../../../../../doc/src/images/next.png" alt="Next"></a>
</div>
</body>
</html>

View File

@ -0,0 +1,556 @@
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title>Testing simple Perl matches (platform = Windows x64, compiler = Microsoft Visual C++ version 14.1)</title>
<link rel="stylesheet" href="../../../../../../../doc/src/boostbook.css" type="text/css">
<meta name="generator" content="DocBook XSL Stylesheets V1.79.1">
<link rel="home" href="../../../index.html" title="Boost.Regex 7.0.1">
<link rel="up" href="../performance.html" title="Performance">
<link rel="prev" href="section_id3752650613.html" title="Testing Perl searches (platform = Windows x64, compiler = Microsoft Visual C++ version 14.1)">
<link rel="next" href="section_id4148872883.html" title="Testing leftmost-longest searches (platform = linux, compiler = GNU C++ version 6.3.0)">
</head>
<body bgcolor="white" text="black" link="#0000FF" vlink="#840084" alink="#0000FF">
<table cellpadding="2" width="100%"><tr>
<td valign="top"><img alt="Boost C++ Libraries" width="277" height="86" src="../../../../../../../boost.png"></td>
<td align="center"><a href="../../../../../../../index.html">Home</a></td>
<td align="center"><a href="../../../../../../../libs/libraries.htm">Libraries</a></td>
<td align="center"><a href="http://www.boost.org/users/people.html">People</a></td>
<td align="center"><a href="http://www.boost.org/users/faq.html">FAQ</a></td>
<td align="center"><a href="../../../../../../../more/index.htm">More</a></td>
</tr></table>
<hr>
<div class="spirit-nav">
<a accesskey="p" href="section_id3752650613.html"><img src="../../../../../../../doc/src/images/prev.png" alt="Prev"></a><a accesskey="u" href="../performance.html"><img src="../../../../../../../doc/src/images/up.png" alt="Up"></a><a accesskey="h" href="../../../index.html"><img src="../../../../../../../doc/src/images/home.png" alt="Home"></a><a accesskey="n" href="section_id4148872883.html"><img src="../../../../../../../doc/src/images/next.png" alt="Next"></a>
</div>
<div class="section">
<div class="titlepage"><div><div><h4 class="title">
<a name="boost_regex.background.performance.section_id4128344975"></a><a class="link" href="section_id4128344975.html" title="Testing simple Perl matches (platform = Windows x64, compiler = Microsoft Visual C++ version 14.1)">Testing
simple Perl matches (platform = Windows x64, compiler = Microsoft Visual
C++ version 14.1)</a>
</h4></div></div></div>
<div class="table">
<a name="boost_regex.background.performance.section_id4128344975.table_Testing_simple_Perl_matches_platform_Windows_x64_compiler_Microsoft_Visual_C_version_14_1_"></a><p class="title"><b>Table 14. Testing simple Perl matches (platform = Windows x64, compiler =
Microsoft Visual C++ version 14.1)</b></p>
<div class="table-contents"><table class="table" summary="Testing simple Perl matches (platform = Windows x64, compiler =
Microsoft Visual C++ version 14.1)">
<colgroup>
<col>
<col>
<col>
<col>
<col>
<col>
</colgroup>
<thead><tr>
<th>
<p>
Expression<br> Text
</p>
</th>
<th>
<p>
boost 1.65
</p>
</th>
<th>
<p>
PCRE-10.10
</p>
</th>
<th>
<p>
RE2
</p>
</th>
<th>
<p>
std::regex
</p>
</th>
<th>
<p>
boost::xpressive::cregex
</p>
</th>
</tr></thead>
<tbody>
<tr>
<td>
<p>
<code class="literal">([[:digit:]]{4}[- ]){3}[[:digit:]]{3,4}</code><br>
<code class="literal">1234-5678-1234-456</code>
</p>
</td>
<td>
<p>
<span class="blue">1.90<br> (328ns)</span>
</p>
</td>
<td>
<p>
<span class="green">1.18<br> (205ns)</span>
</p>
</td>
<td>
<p>
<span class="green">1.00<br> (173ns)</span>
</p>
</td>
<td>
<p>
<span class="red">27.81<br> (4811ns)</span>
</p>
</td>
<td>
<p>
<span class="blue">1.32<br> (228ns)</span>
</p>
</td>
</tr>
<tr>
<td>
<p>
<code class="literal">^([0-9]+)(\-| |$)(.*)$</code><br> <code class="literal">100-
this is a line of ftp response which contains a message string</code>
</p>
</td>
<td>
<p>
<span class="blue">1.45<br> (251ns)</span>
</p>
</td>
<td>
<p>
<span class="blue">1.73<br> (300ns)</span>
</p>
</td>
<td>
<p>
<span class="blue">2.14<br> (371ns)</span>
</p>
</td>
<td>
<p>
<span class="red">24.75<br> (4281ns)</span>
</p>
</td>
<td>
<p>
<span class="green">1.00<br> (173ns)</span>
</p>
</td>
</tr>
<tr>
<td>
<p>
<code class="literal">^([a-zA-Z0-9_\-\.]+)@((\[[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\.)|(([a-zA-Z0-9\-]+\.)+))([a-zA-Z]{2,4}|[0-9]{1,3})(\
...</code><br> <code class="literal">bob.smith@foo.tv</code>
</p>
</td>
<td>
<p>
<span class="blue">2.53<br> (403ns)</span>
</p>
</td>
<td>
<p>
<span class="blue">2.13<br> (338ns)</span>
</p>
</td>
<td>
<p>
<span class="green">1.00<br> (159ns)</span>
</p>
</td>
<td>
<p>
<span class="red">34.16<br> (5432ns)</span>
</p>
</td>
<td>
<p>
<span class="blue">1.86<br> (295ns)</span>
</p>
</td>
</tr>
<tr>
<td>
<p>
<code class="literal">^([a-zA-Z0-9_\-\.]+)@((\[[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\.)|(([a-zA-Z0-9\-]+\.)+))([a-zA-Z]{2,4}|[0-9]{1,3})(\
...</code><br> <code class="literal">foo12@foo.edu</code>
</p>
</td>
<td>
<p>
<span class="blue">2.75<br> (402ns)</span>
</p>
</td>
<td>
<p>
<span class="blue">2.34<br> (342ns)</span>
</p>
</td>
<td>
<p>
<span class="green">1.00<br> (146ns)</span>
</p>
</td>
<td>
<p>
<span class="red">40.78<br> (5954ns)</span>
</p>
</td>
<td>
<p>
<span class="blue">2.01<br> (294ns)</span>
</p>
</td>
</tr>
<tr>
<td>
<p>
<code class="literal">^([a-zA-Z0-9_\-\.]+)@((\[[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\.)|(([a-zA-Z0-9\-]+\.)+))([a-zA-Z]{2,4}|[0-9]{1,3})(\
...</code><br> <code class="literal">john@johnmaddock.co.uk</code>
</p>
</td>
<td>
<p>
<span class="blue">2.54<br> (469ns)</span>
</p>
</td>
<td>
<p>
<span class="blue">2.16<br> (399ns)</span>
</p>
</td>
<td>
<p>
<span class="green">1.00<br> (185ns)</span>
</p>
</td>
<td>
<p>
<span class="red">44.27<br> (8190ns)</span>
</p>
</td>
<td>
<p>
<span class="blue">2.04<br> (377ns)</span>
</p>
</td>
</tr>
<tr>
<td>
<p>
<code class="literal">^[-+]?[[:digit:]]*\.?[[:digit:]]*$</code><br>
<code class="literal">+3.14159</code>
</p>
</td>
<td>
<p>
<span class="blue">1.53<br> (171ns)</span>
</p>
</td>
<td>
<p>
<span class="green">1.14<br> (128ns)</span>
</p>
</td>
<td>
<p>
<span class="green">1.11<br> (124ns)</span>
</p>
</td>
<td>
<p>
<span class="red">21.63<br> (2422ns)</span>
</p>
</td>
<td>
<p>
<span class="green">1.00<br> (112ns)</span>
</p>
</td>
</tr>
<tr>
<td>
<p>
<code class="literal">^[-+]?[[:digit:]]*\.?[[:digit:]]*$</code><br>
<code class="literal">-3.14159</code>
</p>
</td>
<td>
<p>
<span class="blue">1.50<br> (167ns)</span>
</p>
</td>
<td>
<p>
<span class="green">1.15<br> (128ns)</span>
</p>
</td>
<td>
<p>
<span class="green">1.13<br> (125ns)</span>
</p>
</td>
<td>
<p>
<span class="red">21.92<br> (2433ns)</span>
</p>
</td>
<td>
<p>
<span class="green">1.00<br> (111ns)</span>
</p>
</td>
</tr>
<tr>
<td>
<p>
<code class="literal">^[-+]?[[:digit:]]*\.?[[:digit:]]*$</code><br>
<code class="literal">123</code>
</p>
</td>
<td>
<p>
<span class="blue">1.40<br> (143ns)</span>
</p>
</td>
<td>
<p>
<span class="green">1.15<br> (117ns)</span>
</p>
</td>
<td>
<p>
<span class="green">1.03<br> (105ns)</span>
</p>
</td>
<td>
<p>
<span class="red">35.65<br> (3636ns)</span>
</p>
</td>
<td>
<p>
<span class="green">1.00<br> (102ns)</span>
</p>
</td>
</tr>
<tr>
<td>
<p>
<code class="literal">^[[:digit:]]{1,2}/[[:digit:]]{1,2}/[[:digit:]]{4}$</code><br>
<code class="literal">12/12/2001</code>
</p>
</td>
<td>
<p>
<span class="blue">1.47<br> (157ns)</span>
</p>
</td>
<td>
<p>
<span class="green">1.00<br> (107ns)</span>
</p>
</td>
<td>
<p>
<span class="blue">1.27<br> (136ns)</span>
</p>
</td>
<td>
<p>
<span class="red">16.75<br> (1792ns)</span>
</p>
</td>
<td>
<p>
<span class="green">1.03<br> (110ns)</span>
</p>
</td>
</tr>
<tr>
<td>
<p>
<code class="literal">^[[:digit:]]{1,2}/[[:digit:]]{1,2}/[[:digit:]]{4}$</code><br>
<code class="literal">4/1/2001</code>
</p>
</td>
<td>
<p>
<span class="blue">1.39<br> (145ns)</span>
</p>
</td>
<td>
<p>
<span class="green">1.00<br> (104ns)</span>
</p>
</td>
<td>
<p>
<span class="green">1.13<br> (117ns)</span>
</p>
</td>
<td>
<p>
<span class="red">16.90<br> (1758ns)</span>
</p>
</td>
<td>
<p>
<span class="green">1.07<br> (111ns)</span>
</p>
</td>
</tr>
<tr>
<td>
<p>
<code class="literal">^[a-zA-Z]{1,2}[0-9][0-9A-Za-z]{0,1} {0,1}[0-9][A-Za-z]{2}$</code><br>
<code class="literal">EH10 2QQ</code>
</p>
</td>
<td>
<p>
<span class="blue">1.44<br> (164ns)</span>
</p>
</td>
<td>
<p>
<span class="green">1.00<br> (114ns)</span>
</p>
</td>
<td>
<p>
<span class="green">1.10<br> (125ns)</span>
</p>
</td>
<td>
<p>
<span class="red">15.61<br> (1779ns)</span>
</p>
</td>
<td>
<p>
<span class="green">1.06<br> (121ns)</span>
</p>
</td>
</tr>
<tr>
<td>
<p>
<code class="literal">^[a-zA-Z]{1,2}[0-9][0-9A-Za-z]{0,1} {0,1}[0-9][A-Za-z]{2}$</code><br>
<code class="literal">G1 1AA</code>
</p>
</td>
<td>
<p>
<span class="blue">1.36<br> (152ns)</span>
</p>
</td>
<td>
<p>
<span class="green">1.00<br> (112ns)</span>
</p>
</td>
<td>
<p>
<span class="green">1.04<br> (117ns)</span>
</p>
</td>
<td>
<p>
<span class="red">15.86<br> (1776ns)</span>
</p>
</td>
<td>
<p>
<span class="green">1.05<br> (118ns)</span>
</p>
</td>
</tr>
<tr>
<td>
<p>
<code class="literal">^[a-zA-Z]{1,2}[0-9][0-9A-Za-z]{0,1} {0,1}[0-9][A-Za-z]{2}$</code><br>
<code class="literal">SW1 1ZZ</code>
</p>
</td>
<td>
<p>
<span class="blue">1.40<br> (158ns)</span>
</p>
</td>
<td>
<p>
<span class="green">1.00<br> (113ns)</span>
</p>
</td>
<td>
<p>
<span class="green">1.10<br> (124ns)</span>
</p>
</td>
<td>
<p>
<span class="red">15.86<br> (1792ns)</span>
</p>
</td>
<td>
<p>
<span class="green">1.07<br> (121ns)</span>
</p>
</td>
</tr>
<tr>
<td>
<p>
<code class="literal">abc</code><br> <code class="literal">abc</code>
</p>
</td>
<td>
<p>
<span class="blue">2.01<br> (141ns)</span>
</p>
</td>
<td>
<p>
<span class="green">1.00<br> (70ns)</span>
</p>
</td>
<td>
<p>
<span class="green">1.17<br> (82ns)</span>
</p>
</td>
<td>
<p>
<span class="red">8.24<br> (577ns)</span>
</p>
</td>
<td>
<p>
<span class="green">1.19<br> (83ns)</span>
</p>
</td>
</tr>
</tbody>
</table></div>
</div>
<br class="table-break">
</div>
<table xmlns:rev="http://www.cs.rpi.edu/~gregod/boost/tools/doc/revision" width="100%"><tr>
<td align="left"></td>
<td align="right"><div class="copyright-footer">Copyright © 1998-2013 John Maddock<p>
Distributed under the Boost Software License, Version 1.0. (See accompanying
file LICENSE_1_0.txt or copy at <a href="http://www.boost.org/LICENSE_1_0.txt" target="_top">http://www.boost.org/LICENSE_1_0.txt</a>)
</p>
</div></td>
</tr></table>
<hr>
<div class="spirit-nav">
<a accesskey="p" href="section_id3752650613.html"><img src="../../../../../../../doc/src/images/prev.png" alt="Prev"></a><a accesskey="u" href="../performance.html"><img src="../../../../../../../doc/src/images/up.png" alt="Up"></a><a accesskey="h" href="../../../index.html"><img src="../../../../../../../doc/src/images/home.png" alt="Home"></a><a accesskey="n" href="section_id4148872883.html"><img src="../../../../../../../doc/src/images/next.png" alt="Next"></a>
</div>
</body>
</html>

View File

@ -0,0 +1,150 @@
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title>Testing leftmost-longest searches (platform = linux, compiler = GNU C++ version 6.3.0)</title>
<link rel="stylesheet" href="../../../../../../../doc/src/boostbook.css" type="text/css">
<meta name="generator" content="DocBook XSL Stylesheets V1.79.1">
<link rel="home" href="../../../index.html" title="Boost.Regex 7.0.1">
<link rel="up" href="../performance.html" title="Performance">
<link rel="prev" href="section_id4128344975.html" title="Testing simple Perl matches (platform = Windows x64, compiler = Microsoft Visual C++ version 14.1)">
<link rel="next" href="../standards.html" title="Standards Conformance">
</head>
<body bgcolor="white" text="black" link="#0000FF" vlink="#840084" alink="#0000FF">
<table cellpadding="2" width="100%"><tr>
<td valign="top"><img alt="Boost C++ Libraries" width="277" height="86" src="../../../../../../../boost.png"></td>
<td align="center"><a href="../../../../../../../index.html">Home</a></td>
<td align="center"><a href="../../../../../../../libs/libraries.htm">Libraries</a></td>
<td align="center"><a href="http://www.boost.org/users/people.html">People</a></td>
<td align="center"><a href="http://www.boost.org/users/faq.html">FAQ</a></td>
<td align="center"><a href="../../../../../../../more/index.htm">More</a></td>
</tr></table>
<hr>
<div class="spirit-nav">
<a accesskey="p" href="section_id4128344975.html"><img src="../../../../../../../doc/src/images/prev.png" alt="Prev"></a><a accesskey="u" href="../performance.html"><img src="../../../../../../../doc/src/images/up.png" alt="Up"></a><a accesskey="h" href="../../../index.html"><img src="../../../../../../../doc/src/images/home.png" alt="Home"></a><a accesskey="n" href="../standards.html"><img src="../../../../../../../doc/src/images/next.png" alt="Next"></a>
</div>
<div class="section">
<div class="titlepage"><div><div><h4 class="title">
<a name="boost_regex.background.performance.section_id4148872883"></a><a class="link" href="section_id4148872883.html" title="Testing leftmost-longest searches (platform = linux, compiler = GNU C++ version 6.3.0)">Testing
leftmost-longest searches (platform = linux, compiler = GNU C++ version 6.3.0)</a>
</h4></div></div></div>
<div class="table">
<a name="boost_regex.background.performance.section_id4148872883.table_Testing_leftmost_longest_searches_platform_linux_compiler_GNU_C_version_6_3_0_"></a><p class="title"><b>Table 15. Testing leftmost-longest searches (platform = linux, compiler =
GNU C++ version 6.3.0)</b></p>
<div class="table-contents"><table class="table" summary="Testing leftmost-longest searches (platform = linux, compiler =
GNU C++ version 6.3.0)">
<colgroup>
<col>
<col>
<col>
<col>
</colgroup>
<thead><tr>
<th>
<p>
Expression<br> Text
</p>
</th>
<th>
<p>
boost 1.65
</p>
</th>
<th>
<p>
std::regex
</p>
</th>
<th>
<p>
POSIX
</p>
</th>
</tr></thead>
<tbody>
<tr>
<td>
<p>
<code class="literal">&lt;a[^&gt;]+href=("[^"]*"|[^[:space:]]+)[^&gt;]*&gt;</code><br>
In file: ..<span class="emphasis"><em>..</em></span>../libs/libraries.htm
</p>
</td>
<td>
<p>
<span class="green">1.00<br> (107026ns)</span>
</p>
</td>
<td>
<p>
<span class="blue">1.44<br> (154551ns)</span>
</p>
</td>
<td>
<p>
<span class="blue">1.64<br> (175184ns)</span>
</p>
</td>
</tr>
<tr>
<td>
<p>
<code class="literal">&lt;img[^&gt;]+src=("[^"]*"|[^[:space:]]+)[^&gt;]*&gt;</code><br>
In file: ..<span class="emphasis"><em>..</em></span>../libs/libraries.htm
</p>
</td>
<td>
<p>
<span class="green">1.00<br> (15420ns)</span>
</p>
</td>
<td>
<p>
<span class="red">6.89<br> (106275ns)</span>
</p>
</td>
<td>
<p>
<span class="blue">1.59<br> (24567ns)</span>
</p>
</td>
</tr>
<tr>
<td>
<p>
<code class="literal">Beman|John|Dave</code><br> In file: ..<span class="emphasis"><em>..</em></span>../libs/libraries.htm
</p>
</td>
<td>
<p>
<span class="green">1.03<br> (5399ns)</span>
</p>
</td>
<td>
<p>
<span class="red">36.27<br> (190577ns)</span>
</p>
</td>
<td>
<p>
<span class="green">1.00<br> (5254ns)</span>
</p>
</td>
</tr>
</tbody>
</table></div>
</div>
<br class="table-break">
</div>
<table xmlns:rev="http://www.cs.rpi.edu/~gregod/boost/tools/doc/revision" width="100%"><tr>
<td align="left"></td>
<td align="right"><div class="copyright-footer">Copyright © 1998-2013 John Maddock<p>
Distributed under the Boost Software License, Version 1.0. (See accompanying
file LICENSE_1_0.txt or copy at <a href="http://www.boost.org/LICENSE_1_0.txt" target="_top">http://www.boost.org/LICENSE_1_0.txt</a>)
</p>
</div></td>
</tr></table>
<hr>
<div class="spirit-nav">
<a accesskey="p" href="section_id4128344975.html"><img src="../../../../../../../doc/src/images/prev.png" alt="Prev"></a><a accesskey="u" href="../performance.html"><img src="../../../../../../../doc/src/images/up.png" alt="Up"></a><a accesskey="h" href="../../../index.html"><img src="../../../../../../../doc/src/images/home.png" alt="Home"></a><a accesskey="n" href="../standards.html"><img src="../../../../../../../doc/src/images/next.png" alt="Next"></a>
</div>
</body>
</html>

View File

@ -0,0 +1,61 @@
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title>Redistributables</title>
<link rel="stylesheet" href="../../../../../../doc/src/boostbook.css" type="text/css">
<meta name="generator" content="DocBook XSL Stylesheets V1.79.1">
<link rel="home" href="../../index.html" title="Boost.Regex 7.0.1">
<link rel="up" href="../background.html" title="Background Information">
<link rel="prev" href="standards.html" title="Standards Conformance">
<link rel="next" href="acknowledgements.html" title="Acknowledgements">
</head>
<body bgcolor="white" text="black" link="#0000FF" vlink="#840084" alink="#0000FF">
<table cellpadding="2" width="100%"><tr>
<td valign="top"><img alt="Boost C++ Libraries" width="277" height="86" src="../../../../../../boost.png"></td>
<td align="center"><a href="../../../../../../index.html">Home</a></td>
<td align="center"><a href="../../../../../../libs/libraries.htm">Libraries</a></td>
<td align="center"><a href="http://www.boost.org/users/people.html">People</a></td>
<td align="center"><a href="http://www.boost.org/users/faq.html">FAQ</a></td>
<td align="center"><a href="../../../../../../more/index.htm">More</a></td>
</tr></table>
<hr>
<div class="spirit-nav">
<a accesskey="p" href="standards.html"><img src="../../../../../../doc/src/images/prev.png" alt="Prev"></a><a accesskey="u" href="../background.html"><img src="../../../../../../doc/src/images/up.png" alt="Up"></a><a accesskey="h" href="../../index.html"><img src="../../../../../../doc/src/images/home.png" alt="Home"></a><a accesskey="n" href="acknowledgements.html"><img src="../../../../../../doc/src/images/next.png" alt="Next"></a>
</div>
<div class="section">
<div class="titlepage"><div><div><h3 class="title">
<a name="boost_regex.background.redist"></a><a class="link" href="redist.html" title="Redistributables">Redistributables</a>
</h3></div></div></div>
<p>
If you are using Microsoft or Borland C++ and link to a dll version of the
run time library, then you can choose to also link to a dll version of Boost.Regex
by defining the symbol BOOST_REGEX_DYN_LINK when you compile your code. While
these dll's are redistributable, there are no "standard" versions,
so when installing on the users PC, you should place these in a directory
private to your application, and not in the PC's directory path. Note that
if you link to a static version of your run time library, then you will also
link to a static version of Boost.Regex and no dll's will need to be distributed.
The possible Boost.Regex dll and library names are computed according to
the formula given in <a href="../../../../../../more/getting_started.html" target="_top">the
getting started guide</a>.
</p>
<p>
Note: you can disable automatic library selection by defining the symbol
BOOST_REGEX_NO_LIB when compiling, this is useful if you want to build Boost.Regex
yourself in your IDE, or if you need to debug Boost.Regex.
</p>
</div>
<table xmlns:rev="http://www.cs.rpi.edu/~gregod/boost/tools/doc/revision" width="100%"><tr>
<td align="left"></td>
<td align="right"><div class="copyright-footer">Copyright © 1998-2013 John Maddock<p>
Distributed under the Boost Software License, Version 1.0. (See accompanying
file LICENSE_1_0.txt or copy at <a href="http://www.boost.org/LICENSE_1_0.txt" target="_top">http://www.boost.org/LICENSE_1_0.txt</a>)
</p>
</div></td>
</tr></table>
<hr>
<div class="spirit-nav">
<a accesskey="p" href="standards.html"><img src="../../../../../../doc/src/images/prev.png" alt="Prev"></a><a accesskey="u" href="../background.html"><img src="../../../../../../doc/src/images/up.png" alt="Up"></a><a accesskey="h" href="../../index.html"><img src="../../../../../../doc/src/images/home.png" alt="Home"></a><a accesskey="n" href="acknowledgements.html"><img src="../../../../../../doc/src/images/next.png" alt="Next"></a>
</div>
</body>
</html>

View File

@ -0,0 +1,573 @@
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title>Standards Conformance</title>
<link rel="stylesheet" href="../../../../../../doc/src/boostbook.css" type="text/css">
<meta name="generator" content="DocBook XSL Stylesheets V1.79.1">
<link rel="home" href="../../index.html" title="Boost.Regex 7.0.1">
<link rel="up" href="../background.html" title="Background Information">
<link rel="prev" href="performance/section_id4148872883.html" title="Testing leftmost-longest searches (platform = linux, compiler = GNU C++ version 6.3.0)">
<link rel="next" href="redist.html" title="Redistributables">
</head>
<body bgcolor="white" text="black" link="#0000FF" vlink="#840084" alink="#0000FF">
<table cellpadding="2" width="100%"><tr>
<td valign="top"><img alt="Boost C++ Libraries" width="277" height="86" src="../../../../../../boost.png"></td>
<td align="center"><a href="../../../../../../index.html">Home</a></td>
<td align="center"><a href="../../../../../../libs/libraries.htm">Libraries</a></td>
<td align="center"><a href="http://www.boost.org/users/people.html">People</a></td>
<td align="center"><a href="http://www.boost.org/users/faq.html">FAQ</a></td>
<td align="center"><a href="../../../../../../more/index.htm">More</a></td>
</tr></table>
<hr>
<div class="spirit-nav">
<a accesskey="p" href="performance/section_id4148872883.html"><img src="../../../../../../doc/src/images/prev.png" alt="Prev"></a><a accesskey="u" href="../background.html"><img src="../../../../../../doc/src/images/up.png" alt="Up"></a><a accesskey="h" href="../../index.html"><img src="../../../../../../doc/src/images/home.png" alt="Home"></a><a accesskey="n" href="redist.html"><img src="../../../../../../doc/src/images/next.png" alt="Next"></a>
</div>
<div class="section">
<div class="titlepage"><div><div><h3 class="title">
<a name="boost_regex.background.standards"></a><a class="link" href="standards.html" title="Standards Conformance">Standards Conformance</a>
</h3></div></div></div>
<h5>
<a name="boost_regex.background.standards.h0"></a>
<span class="phrase"><a name="boost_regex.background.standards.c"></a></span><a class="link" href="standards.html#boost_regex.background.standards.c">C++</a>
</h5>
<p>
Boost.Regex is intended to conform to the <a href="http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2005/n1836.pdf" target="_top">Technical
Report on C++ Library Extensions</a>.
</p>
<h5>
<a name="boost_regex.background.standards.h1"></a>
<span class="phrase"><a name="boost_regex.background.standards.ecmascript_javascript"></a></span><a class="link" href="standards.html#boost_regex.background.standards.ecmascript_javascript">ECMAScript
/ JavaScript</a>
</h5>
<p>
All of the ECMAScript regular expression syntax features are supported, except
that:
</p>
<p>
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.
</p>
<h5>
<a name="boost_regex.background.standards.h2"></a>
<span class="phrase"><a name="boost_regex.background.standards.perl"></a></span><a class="link" href="standards.html#boost_regex.background.standards.perl">Perl</a>
</h5>
<p>
Almost all Perl features are supported, except for:
</p>
<p>
(?{code}) Not implementable in a compiled strongly typed language.
</p>
<p>
(??{code}) Not implementable in a compiled strongly typed language.
</p>
<p>
(*VERB) The <a href="http://perldoc.perl.org/perlre.html#Special-Backtracking-Control-Verbs" target="_top">backtracking
control verbs</a> are not recognised or implemented at this time.
</p>
<p>
In addition the following features behave slightly differently from Perl:
</p>
<p>
^ $ \Z These recognise any line termination sequence, and not just \n: see
the Unicode requirements below.
</p>
<h5>
<a name="boost_regex.background.standards.h3"></a>
<span class="phrase"><a name="boost_regex.background.standards.posix"></a></span><a class="link" href="standards.html#boost_regex.background.standards.posix">POSIX</a>
</h5>
<p>
All the POSIX basic and extended regular expression features are supported,
except that:
</p>
<p>
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.
</p>
<p>
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.
</p>
<h5>
<a name="boost_regex.background.standards.h4"></a>
<span class="phrase"><a name="boost_regex.background.standards.unicode"></a></span><a class="link" href="standards.html#boost_regex.background.standards.unicode">Unicode</a>
</h5>
<p>
The following comments refer to <a href="http://unicode.org/reports/tr18/" target="_top">Unicode
Technical Standard #18: Unicode Regular Expressions version 11</a>.
</p>
<div class="informaltable"><table class="table">
<colgroup>
<col>
<col>
<col>
</colgroup>
<thead><tr>
<th>
<p>
Item
</p>
</th>
<th>
<p>
Feature
</p>
</th>
<th>
<p>
Support
</p>
</th>
</tr></thead>
<tbody>
<tr>
<td>
<p>
1.1
</p>
</td>
<td>
<p>
Hex Notation
</p>
</td>
<td>
<p>
Yes: use \x{DDDD} to refer to code point UDDDD.
</p>
</td>
</tr>
<tr>
<td>
<p>
1.2
</p>
</td>
<td>
<p>
Character Properties
</p>
</td>
<td>
<p>
All the names listed under the General Category Property are supported.
Script names and Other Names are not currently supported.
</p>
</td>
</tr>
<tr>
<td>
<p>
1.3
</p>
</td>
<td>
<p>
Subtraction and Intersection
</p>
</td>
<td>
<p>
Indirectly support by forward-lookahead:
</p>
<p>
<code class="computeroutput"><span class="special">(?=[[:</span><span class="identifier">X</span><span class="special">:]])[[:</span><span class="identifier">Y</span><span class="special">:]]</span></code>
</p>
<p>
Gives the intersection of character properties X and Y.
</p>
<p>
<code class="computeroutput"><span class="special">(?![[:</span><span class="identifier">X</span><span class="special">:]])[[:</span><span class="identifier">Y</span><span class="special">:]]</span></code>
</p>
<p>
Gives everything in Y that is not in X (subtraction).
</p>
</td>
</tr>
<tr>
<td>
<p>
1.4
</p>
</td>
<td>
<p>
Simple Word Boundaries
</p>
</td>
<td>
<p>
Conforming: non-spacing marks are included in the set of word characters.
</p>
</td>
</tr>
<tr>
<td>
<p>
1.5
</p>
</td>
<td>
<p>
Caseless Matching
</p>
</td>
<td>
<p>
Supported, note that at this level, case transformations are 1:1,
many to many case folding operations are not supported (for example
"ß" to "SS").
</p>
</td>
</tr>
<tr>
<td>
<p>
1.6
</p>
</td>
<td>
<p>
Line Boundaries
</p>
</td>
<td>
<p>
Supported, except that "." matches only one character
of "\r\n". Other than that word boundaries match correctly;
including not matching in the middle of a "\r\n" sequence.
</p>
</td>
</tr>
<tr>
<td>
<p>
1.7
</p>
</td>
<td>
<p>
Code Points
</p>
</td>
<td>
<p>
Supported: provided you use the u32* algorithms, then UTF-8, UTF-16
and UTF-32 are all treated as sequences of 32-bit code points.
</p>
</td>
</tr>
<tr>
<td>
<p>
2.1
</p>
</td>
<td>
<p>
Canonical Equivalence
</p>
</td>
<td>
<p>
Not supported: it is up to the user of the library to convert all
text into the same canonical form as the regular expression.
</p>
</td>
</tr>
<tr>
<td>
<p>
2.2
</p>
</td>
<td>
<p>
Default Grapheme Clusters
</p>
</td>
<td>
<p>
Not supported.
</p>
</td>
</tr>
<tr>
<td>
<p>
2.3Default Word Boundaries
</p>
</td>
<td>
<p>
Not supported.
</p>
</td>
<td class="auto-generated"> </td>
</tr>
<tr>
<td>
<p>
2.4
</p>
</td>
<td>
<p>
Default Loose Matches
</p>
</td>
<td>
<p>
Not Supported.
</p>
</td>
</tr>
<tr>
<td>
<p>
2.5
</p>
</td>
<td>
<p>
Named Properties
</p>
</td>
<td>
<p>
Supported: the expression "[[:name:]]" or \N{name} matches
the named character "name".
</p>
</td>
</tr>
<tr>
<td>
<p>
2.6
</p>
</td>
<td>
<p>
Wildcard properties
</p>
</td>
<td>
<p>
Not Supported.
</p>
</td>
</tr>
<tr>
<td>
<p>
3.1
</p>
</td>
<td>
<p>
Tailored Punctuation.
</p>
</td>
<td>
<p>
Not Supported.
</p>
</td>
</tr>
<tr>
<td>
<p>
3.2
</p>
</td>
<td>
<p>
Tailored Grapheme Clusters
</p>
</td>
<td>
<p>
Not Supported.
</p>
</td>
</tr>
<tr>
<td>
<p>
3.3
</p>
</td>
<td>
<p>
Tailored Word Boundaries.
</p>
</td>
<td>
<p>
Not Supported.
</p>
</td>
</tr>
<tr>
<td>
<p>
3.4
</p>
</td>
<td>
<p>
Tailored Loose Matches
</p>
</td>
<td>
<p>
Partial support: [[=c=]] matches characters with the same primary
equivalence class as "c".
</p>
</td>
</tr>
<tr>
<td>
<p>
3.5
</p>
</td>
<td>
<p>
Tailored Ranges
</p>
</td>
<td>
<p>
Supported: [a-b] matches any character that collates in the range
a to b, when the expression is constructed with the collate flag
set.
</p>
</td>
</tr>
<tr>
<td>
<p>
3.6
</p>
</td>
<td>
<p>
Context Matches
</p>
</td>
<td>
<p>
Not Supported.
</p>
</td>
</tr>
<tr>
<td>
<p>
3.7
</p>
</td>
<td>
<p>
Incremental Matches
</p>
</td>
<td>
<p>
Supported: pass the flag <code class="computeroutput"><span class="identifier">match_partial</span></code>
to the regex algorithms.
</p>
</td>
</tr>
<tr>
<td>
<p>
3.8
</p>
</td>
<td>
<p>
Unicode Set Sharing
</p>
</td>
<td>
<p>
Not Supported.
</p>
</td>
</tr>
<tr>
<td>
<p>
3.9
</p>
</td>
<td>
<p>
Possible Match Sets
</p>
</td>
<td>
<p>
Not supported, however this information is used internally to optimise
the matching of regular expressions, and return quickly if no match
is possible.
</p>
</td>
</tr>
<tr>
<td>
<p>
3.10
</p>
</td>
<td>
<p>
Folded Matching
</p>
</td>
<td>
<p>
Partial Support: It is possible to achieve a similar effect by
using a custom regular expression traits class.
</p>
</td>
</tr>
<tr>
<td>
<p>
3.11
</p>
</td>
<td>
<p>
Custom Submatch Evaluation
</p>
</td>
<td>
<p>
Not Supported.
</p>
</td>
</tr>
</tbody>
</table></div>
</div>
<table xmlns:rev="http://www.cs.rpi.edu/~gregod/boost/tools/doc/revision" width="100%"><tr>
<td align="left"></td>
<td align="right"><div class="copyright-footer">Copyright © 1998-2013 John Maddock<p>
Distributed under the Boost Software License, Version 1.0. (See accompanying
file LICENSE_1_0.txt or copy at <a href="http://www.boost.org/LICENSE_1_0.txt" target="_top">http://www.boost.org/LICENSE_1_0.txt</a>)
</p>
</div></td>
</tr></table>
<hr>
<div class="spirit-nav">
<a accesskey="p" href="performance/section_id4148872883.html"><img src="../../../../../../doc/src/images/prev.png" alt="Prev"></a><a accesskey="u" href="../background.html"><img src="../../../../../../doc/src/images/up.png" alt="Up"></a><a accesskey="h" href="../../index.html"><img src="../../../../../../doc/src/images/home.png" alt="Home"></a><a accesskey="n" href="redist.html"><img src="../../../../../../doc/src/images/next.png" alt="Next"></a>
</div>
</body>
</html>

View File

@ -0,0 +1,84 @@
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title>Thread Safety</title>
<link rel="stylesheet" href="../../../../../../doc/src/boostbook.css" type="text/css">
<meta name="generator" content="DocBook XSL Stylesheets V1.79.1">
<link rel="home" href="../../index.html" title="Boost.Regex 7.0.1">
<link rel="up" href="../background.html" title="Background Information">
<link rel="prev" href="locale.html" title="Localization">
<link rel="next" href="examples.html" title="Test and Example Programs">
</head>
<body bgcolor="white" text="black" link="#0000FF" vlink="#840084" alink="#0000FF">
<table cellpadding="2" width="100%"><tr>
<td valign="top"><img alt="Boost C++ Libraries" width="277" height="86" src="../../../../../../boost.png"></td>
<td align="center"><a href="../../../../../../index.html">Home</a></td>
<td align="center"><a href="../../../../../../libs/libraries.htm">Libraries</a></td>
<td align="center"><a href="http://www.boost.org/users/people.html">People</a></td>
<td align="center"><a href="http://www.boost.org/users/faq.html">FAQ</a></td>
<td align="center"><a href="../../../../../../more/index.htm">More</a></td>
</tr></table>
<hr>
<div class="spirit-nav">
<a accesskey="p" href="locale.html"><img src="../../../../../../doc/src/images/prev.png" alt="Prev"></a><a accesskey="u" href="../background.html"><img src="../../../../../../doc/src/images/up.png" alt="Up"></a><a accesskey="h" href="../../index.html"><img src="../../../../../../doc/src/images/home.png" alt="Home"></a><a accesskey="n" href="examples.html"><img src="../../../../../../doc/src/images/next.png" alt="Next"></a>
</div>
<div class="section">
<div class="titlepage"><div><div><h3 class="title">
<a name="boost_regex.background.thread_safety"></a><a class="link" href="thread_safety.html" title="Thread Safety">Thread Safety</a>
</h3></div></div></div>
<p>
The Boost.Regex library is thread safe when Boost is: you can verify that
Boost is in thread safe mode by checking to see if <code class="computeroutput"><span class="identifier">BOOST_HAS_THREADS</span></code>
is defined: this macro is set automatically by the config system when threading
support is turned on in your compiler.
</p>
<p>
Class <a class="link" href="../ref/basic_regex.html" title="basic_regex"><code class="computeroutput"><span class="identifier">basic_regex</span></code></a>
and its typedefs regex and wregex are thread safe, in that compiled regular
expressions can safely be shared between threads. The matching algorithms
<a class="link" href="../ref/regex_match.html" title="regex_match"><code class="computeroutput"><span class="identifier">regex_match</span></code></a>,
<a class="link" href="../ref/regex_search.html" title="regex_search"><code class="computeroutput"><span class="identifier">regex_search</span></code></a>,
and <a class="link" href="../ref/regex_replace.html" title="regex_replace"><code class="computeroutput"><span class="identifier">regex_replace</span></code></a>
are all re-entrant and thread safe. Class <a class="link" href="../ref/match_results.html" title="match_results"><code class="computeroutput"><span class="identifier">match_results</span></code></a> is now thread safe,
in that the results of a match can be safely copied from one thread to another
(for example one thread may find matches and push <a class="link" href="../ref/match_results.html" title="match_results"><code class="computeroutput"><span class="identifier">match_results</span></code></a> instances onto a queue,
while another thread pops them off the other end), otherwise use a separate
instance of <a class="link" href="../ref/match_results.html" title="match_results"><code class="computeroutput"><span class="identifier">match_results</span></code></a>
per thread.
</p>
<p>
The <a class="link" href="../ref/posix.html" title="POSIX Compatible C API's">POSIX API functions</a> are
all re-entrant and thread safe, regular expressions compiled with regcomp
can also be shared between threads.
</p>
<p>
The <a class="link" href="../ref/deprecated/old_regex.html" title="High Level Class RegEx (Deprecated)">class RegEx</a>
is only thread safe if each thread gets its own RegEx instance (apartment
threading) - this is a consequence of RegEx handling both compiling and matching
regular expressions.
</p>
<p>
Finally note that changing the global locale invalidates all compiled regular
expressions, therefore calling <code class="computeroutput"><span class="identifier">set_locale</span></code>
from one thread while another uses regular expressions will produce unpredictable
results.
</p>
<p>
There is also a requirement that there is only one thread executing prior
to the start of main().
</p>
</div>
<table xmlns:rev="http://www.cs.rpi.edu/~gregod/boost/tools/doc/revision" width="100%"><tr>
<td align="left"></td>
<td align="right"><div class="copyright-footer">Copyright © 1998-2013 John Maddock<p>
Distributed under the Boost Software License, Version 1.0. (See accompanying
file LICENSE_1_0.txt or copy at <a href="http://www.boost.org/LICENSE_1_0.txt" target="_top">http://www.boost.org/LICENSE_1_0.txt</a>)
</p>
</div></td>
</tr></table>
<hr>
<div class="spirit-nav">
<a accesskey="p" href="locale.html"><img src="../../../../../../doc/src/images/prev.png" alt="Prev"></a><a accesskey="u" href="../background.html"><img src="../../../../../../doc/src/images/up.png" alt="Up"></a><a accesskey="h" href="../../index.html"><img src="../../../../../../doc/src/images/home.png" alt="Home"></a><a accesskey="n" href="examples.html"><img src="../../../../../../doc/src/images/next.png" alt="Next"></a>
</div>
</body>
</html>

View File

@ -0,0 +1,386 @@
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title>Understanding Marked Sub-Expressions and Captures</title>
<link rel="stylesheet" href="../../../../../doc/src/boostbook.css" type="text/css">
<meta name="generator" content="DocBook XSL Stylesheets V1.79.1">
<link rel="home" href="../index.html" title="Boost.Regex 7.0.1">
<link rel="up" href="../index.html" title="Boost.Regex 7.0.1">
<link rel="prev" href="unicode.html" title="Unicode and Boost.Regex">
<link rel="next" href="partial_matches.html" title="Partial Matches">
</head>
<body bgcolor="white" text="black" link="#0000FF" vlink="#840084" alink="#0000FF">
<table cellpadding="2" width="100%"><tr>
<td valign="top"><img alt="Boost C++ Libraries" width="277" height="86" src="../../../../../boost.png"></td>
<td align="center"><a href="../../../../../index.html">Home</a></td>
<td align="center"><a href="../../../../../libs/libraries.htm">Libraries</a></td>
<td align="center"><a href="http://www.boost.org/users/people.html">People</a></td>
<td align="center"><a href="http://www.boost.org/users/faq.html">FAQ</a></td>
<td align="center"><a href="../../../../../more/index.htm">More</a></td>
</tr></table>
<hr>
<div class="spirit-nav">
<a accesskey="p" href="unicode.html"><img src="../../../../../doc/src/images/prev.png" alt="Prev"></a><a accesskey="u" href="../index.html"><img src="../../../../../doc/src/images/up.png" alt="Up"></a><a accesskey="h" href="../index.html"><img src="../../../../../doc/src/images/home.png" alt="Home"></a><a accesskey="n" href="partial_matches.html"><img src="../../../../../doc/src/images/next.png" alt="Next"></a>
</div>
<div class="section">
<div class="titlepage"><div><div><h2 class="title" style="clear: both">
<a name="boost_regex.captures"></a><a class="link" href="captures.html" title="Understanding Marked Sub-Expressions and Captures">Understanding Marked Sub-Expressions
and Captures</a>
</h2></div></div></div>
<p>
Captures are the iterator ranges that are "captured" by marked sub-expressions
as a regular expression gets matched. Each marked sub-expression can result
in more than one capture, if it is matched more than once. This document explains
how captures and marked sub-expressions in Boost.Regex are represented and
accessed.
</p>
<h5>
<a name="boost_regex.captures.h0"></a>
<span class="phrase"><a name="boost_regex.captures.marked_sub_expressions"></a></span><a class="link" href="captures.html#boost_regex.captures.marked_sub_expressions">Marked
sub-expressions</a>
</h5>
<p>
Every time a Perl regular expression contains a parenthesis group <code class="computeroutput"><span class="special">()</span></code>, it spits out an extra field, known as a
marked sub-expression, for example the expression:
</p>
<pre class="programlisting">(\w+)\W+(\w+)</pre>
<p>
Has two marked sub-expressions (known as $1 and $2 respectively), in addition
the complete match is known as $&amp;, everything before the first match as
$`, and everything after the match as $'. So if the above expression is searched
for within <code class="computeroutput"><span class="string">"@abc def--"</span></code>,
then we obtain:
</p>
<div class="informaltable"><table class="table">
<colgroup>
<col>
<col>
</colgroup>
<thead><tr>
<th>
<p>
Sub-expression
</p>
</th>
<th>
<p>
Text found
</p>
</th>
</tr></thead>
<tbody>
<tr>
<td>
<p>
$`
</p>
</td>
<td>
<p>
"@"
</p>
</td>
</tr>
<tr>
<td>
<p>
$&amp;
</p>
</td>
<td>
<p>
"abc def"
</p>
</td>
</tr>
<tr>
<td>
<p>
$1
</p>
</td>
<td>
<p>
"abc"
</p>
</td>
</tr>
<tr>
<td>
<p>
$2
</p>
</td>
<td>
<p>
"def"
</p>
</td>
</tr>
<tr>
<td>
<p>
$'
</p>
</td>
<td>
<p>
"--"
</p>
</td>
</tr>
</tbody>
</table></div>
<p>
In Boost.Regex all these are accessible via the <a class="link" href="ref/match_results.html" title="match_results"><code class="computeroutput"><span class="identifier">match_results</span></code></a> class that gets filled
in when calling one of the regular expression matching algorithms ( <a class="link" href="ref/regex_search.html" title="regex_search"><code class="computeroutput"><span class="identifier">regex_search</span></code></a>, <a class="link" href="ref/regex_match.html" title="regex_match"><code class="computeroutput"><span class="identifier">regex_match</span></code></a>, or <a class="link" href="ref/regex_iterator.html" title="regex_iterator"><code class="computeroutput"><span class="identifier">regex_iterator</span></code></a>). So given:
</p>
<pre class="programlisting"><span class="identifier">boost</span><span class="special">::</span><span class="identifier">match_results</span><span class="special">&lt;</span><span class="identifier">IteratorType</span><span class="special">&gt;</span> <span class="identifier">m</span><span class="special">;</span>
</pre>
<p>
The Perl and Boost.Regex equivalents are as follows:
</p>
<div class="informaltable"><table class="table">
<colgroup>
<col>
<col>
</colgroup>
<thead><tr>
<th>
<p>
Perl
</p>
</th>
<th>
<p>
Boost.Regex
</p>
</th>
</tr></thead>
<tbody>
<tr>
<td>
<p>
$`
</p>
</td>
<td>
<p>
<code class="computeroutput"><span class="identifier">m</span><span class="special">.</span><span class="identifier">prefix</span><span class="special">()</span></code>
</p>
</td>
</tr>
<tr>
<td>
<p>
$&amp;
</p>
</td>
<td>
<p>
<code class="computeroutput"><span class="identifier">m</span><span class="special">[</span><span class="number">0</span><span class="special">]</span></code>
</p>
</td>
</tr>
<tr>
<td>
<p>
$n
</p>
</td>
<td>
<p>
<code class="computeroutput"><span class="identifier">m</span><span class="special">[</span><span class="identifier">n</span><span class="special">]</span></code>
</p>
</td>
</tr>
<tr>
<td>
<p>
$'
</p>
</td>
<td>
<p>
<code class="computeroutput"><span class="identifier">m</span><span class="special">.</span><span class="identifier">suffix</span><span class="special">()</span></code>
</p>
</td>
</tr>
</tbody>
</table></div>
<p>
In Boost.Regex each sub-expression match is represented by a <a class="link" href="ref/sub_match.html" title="sub_match"><code class="computeroutput"><span class="identifier">sub_match</span></code></a> object, this is basically
just a pair of iterators denoting the start and end position of the sub-expression
match, but there are some additional operators provided so that objects of
type <a class="link" href="ref/sub_match.html" title="sub_match"><code class="computeroutput"><span class="identifier">sub_match</span></code></a>
behave a lot like a <code class="computeroutput"><span class="identifier">std</span><span class="special">::</span><span class="identifier">basic_string</span></code>: for example they are implicitly
convertible to a <code class="computeroutput"><span class="identifier">basic_string</span></code>,
they can be compared to a string, added to a string, or streamed out to an
output stream.
</p>
<h5>
<a name="boost_regex.captures.h1"></a>
<span class="phrase"><a name="boost_regex.captures.unmatched_sub_expressions"></a></span><a class="link" href="captures.html#boost_regex.captures.unmatched_sub_expressions">Unmatched
Sub-Expressions</a>
</h5>
<p>
When a regular expression match is found there is no need for all of the marked
sub-expressions to have participated in the match, for example the expression:
</p>
<pre class="programlisting">(abc)|(def)</pre>
<p>
can match either $1 or $2, but never both at the same time. In Boost.Regex
you can determine which sub-expressions matched by accessing the <code class="computeroutput"><span class="identifier">sub_match</span><span class="special">::</span><span class="identifier">matched</span></code> data member.
</p>
<h5>
<a name="boost_regex.captures.h2"></a>
<span class="phrase"><a name="boost_regex.captures.repeated_captures"></a></span><a class="link" href="captures.html#boost_regex.captures.repeated_captures">Repeated
Captures</a>
</h5>
<p>
When a marked sub-expression is repeated, then the sub-expression gets "captured"
multiple times, however normally only the final capture is available, for example
if
</p>
<pre class="programlisting">(?:(\w+)\W+)+</pre>
<p>
is matched against
</p>
<pre class="programlisting">one fine day</pre>
<p>
Then $1 will contain the string "day", and all the previous captures
will have been forgotten.
</p>
<p>
However, Boost.Regex has an experimental feature that allows all the capture
information to be retained - this is accessed either via the <code class="computeroutput"><span class="identifier">match_results</span><span class="special">::</span><span class="identifier">captures</span></code> member function or the <code class="computeroutput"><span class="identifier">sub_match</span><span class="special">::</span><span class="identifier">captures</span></code> member function. These functions
return a container that contains a sequence of all the captures obtained during
the regular expression matching. The following example program shows how this
information may be used:
</p>
<pre class="programlisting"><span class="preprocessor">#include</span> <span class="special">&lt;</span><span class="identifier">boost</span><span class="special">/</span><span class="identifier">regex</span><span class="special">.</span><span class="identifier">hpp</span><span class="special">&gt;</span>
<span class="preprocessor">#include</span> <span class="special">&lt;</span><span class="identifier">iostream</span><span class="special">&gt;</span>
<span class="keyword">void</span> <span class="identifier">print_captures</span><span class="special">(</span><span class="keyword">const</span> <span class="identifier">std</span><span class="special">::</span><span class="identifier">string</span><span class="special">&amp;</span> <span class="identifier">regx</span><span class="special">,</span> <span class="keyword">const</span> <span class="identifier">std</span><span class="special">::</span><span class="identifier">string</span><span class="special">&amp;</span> <span class="identifier">text</span><span class="special">)</span>
<span class="special">{</span>
<span class="identifier">boost</span><span class="special">::</span><span class="identifier">regex</span> <span class="identifier">e</span><span class="special">(</span><span class="identifier">regx</span><span class="special">);</span>
<span class="identifier">boost</span><span class="special">::</span><span class="identifier">smatch</span> <span class="identifier">what</span><span class="special">;</span>
<span class="identifier">std</span><span class="special">::</span><span class="identifier">cout</span> <span class="special">&lt;&lt;</span> <span class="string">"Expression: \""</span> <span class="special">&lt;&lt;</span> <span class="identifier">regx</span> <span class="special">&lt;&lt;</span> <span class="string">"\"\n"</span><span class="special">;</span>
<span class="identifier">std</span><span class="special">::</span><span class="identifier">cout</span> <span class="special">&lt;&lt;</span> <span class="string">"Text: \""</span> <span class="special">&lt;&lt;</span> <span class="identifier">text</span> <span class="special">&lt;&lt;</span> <span class="string">"\"\n"</span><span class="special">;</span>
<span class="keyword">if</span><span class="special">(</span><span class="identifier">boost</span><span class="special">::</span><span class="identifier">regex_match</span><span class="special">(</span><span class="identifier">text</span><span class="special">,</span> <span class="identifier">what</span><span class="special">,</span> <span class="identifier">e</span><span class="special">,</span> <span class="identifier">boost</span><span class="special">::</span><span class="identifier">match_extra</span><span class="special">))</span>
<span class="special">{</span>
<span class="keyword">unsigned</span> <span class="identifier">i</span><span class="special">,</span> <span class="identifier">j</span><span class="special">;</span>
<span class="identifier">std</span><span class="special">::</span><span class="identifier">cout</span> <span class="special">&lt;&lt;</span> <span class="string">"** Match found **\n Sub-Expressions:\n"</span><span class="special">;</span>
<span class="keyword">for</span><span class="special">(</span><span class="identifier">i</span> <span class="special">=</span> <span class="number">0</span><span class="special">;</span> <span class="identifier">i</span> <span class="special">&lt;</span> <span class="identifier">what</span><span class="special">.</span><span class="identifier">size</span><span class="special">();</span> <span class="special">++</span><span class="identifier">i</span><span class="special">)</span>
<span class="identifier">std</span><span class="special">::</span><span class="identifier">cout</span> <span class="special">&lt;&lt;</span> <span class="string">" $"</span> <span class="special">&lt;&lt;</span> <span class="identifier">i</span> <span class="special">&lt;&lt;</span> <span class="string">" = \""</span> <span class="special">&lt;&lt;</span> <span class="identifier">what</span><span class="special">[</span><span class="identifier">i</span><span class="special">]</span> <span class="special">&lt;&lt;</span> <span class="string">"\"\n"</span><span class="special">;</span>
<span class="identifier">std</span><span class="special">::</span><span class="identifier">cout</span> <span class="special">&lt;&lt;</span> <span class="string">" Captures:\n"</span><span class="special">;</span>
<span class="keyword">for</span><span class="special">(</span><span class="identifier">i</span> <span class="special">=</span> <span class="number">0</span><span class="special">;</span> <span class="identifier">i</span> <span class="special">&lt;</span> <span class="identifier">what</span><span class="special">.</span><span class="identifier">size</span><span class="special">();</span> <span class="special">++</span><span class="identifier">i</span><span class="special">)</span>
<span class="special">{</span>
<span class="identifier">std</span><span class="special">::</span><span class="identifier">cout</span> <span class="special">&lt;&lt;</span> <span class="string">" $"</span> <span class="special">&lt;&lt;</span> <span class="identifier">i</span> <span class="special">&lt;&lt;</span> <span class="string">" = {"</span><span class="special">;</span>
<span class="keyword">for</span><span class="special">(</span><span class="identifier">j</span> <span class="special">=</span> <span class="number">0</span><span class="special">;</span> <span class="identifier">j</span> <span class="special">&lt;</span> <span class="identifier">what</span><span class="special">.</span><span class="identifier">captures</span><span class="special">(</span><span class="identifier">i</span><span class="special">).</span><span class="identifier">size</span><span class="special">();</span> <span class="special">++</span><span class="identifier">j</span><span class="special">)</span>
<span class="special">{</span>
<span class="keyword">if</span><span class="special">(</span><span class="identifier">j</span><span class="special">)</span>
<span class="identifier">std</span><span class="special">::</span><span class="identifier">cout</span> <span class="special">&lt;&lt;</span> <span class="string">", "</span><span class="special">;</span>
<span class="keyword">else</span>
<span class="identifier">std</span><span class="special">::</span><span class="identifier">cout</span> <span class="special">&lt;&lt;</span> <span class="string">" "</span><span class="special">;</span>
<span class="identifier">std</span><span class="special">::</span><span class="identifier">cout</span> <span class="special">&lt;&lt;</span> <span class="string">"\""</span> <span class="special">&lt;&lt;</span> <span class="identifier">what</span><span class="special">.</span><span class="identifier">captures</span><span class="special">(</span><span class="identifier">i</span><span class="special">)[</span><span class="identifier">j</span><span class="special">]</span> <span class="special">&lt;&lt;</span> <span class="string">"\""</span><span class="special">;</span>
<span class="special">}</span>
<span class="identifier">std</span><span class="special">::</span><span class="identifier">cout</span> <span class="special">&lt;&lt;</span> <span class="string">" }\n"</span><span class="special">;</span>
<span class="special">}</span>
<span class="special">}</span>
<span class="keyword">else</span>
<span class="special">{</span>
<span class="identifier">std</span><span class="special">::</span><span class="identifier">cout</span> <span class="special">&lt;&lt;</span> <span class="string">"** No Match found **\n"</span><span class="special">;</span>
<span class="special">}</span>
<span class="special">}</span>
<span class="keyword">int</span> <span class="identifier">main</span><span class="special">(</span><span class="keyword">int</span> <span class="special">,</span> <span class="keyword">char</span><span class="special">*</span> <span class="special">[])</span>
<span class="special">{</span>
<span class="identifier">print_captures</span><span class="special">(</span><span class="string">"(([[:lower:]]+)|([[:upper:]]+))+"</span><span class="special">,</span> <span class="string">"aBBcccDDDDDeeeeeeee"</span><span class="special">);</span>
<span class="identifier">print_captures</span><span class="special">(</span><span class="string">"(.*)bar|(.*)bah"</span><span class="special">,</span> <span class="string">"abcbar"</span><span class="special">);</span>
<span class="identifier">print_captures</span><span class="special">(</span><span class="string">"(.*)bar|(.*)bah"</span><span class="special">,</span> <span class="string">"abcbah"</span><span class="special">);</span>
<span class="identifier">print_captures</span><span class="special">(</span><span class="string">"^(?:(\\w+)|(?&gt;\\W+))*$"</span><span class="special">,</span>
<span class="string">"now is the time for all good men to come to the aid of the party"</span><span class="special">);</span>
<span class="keyword">return</span> <span class="number">0</span><span class="special">;</span>
<span class="special">}</span>
</pre>
<p>
Which produces the following output:
</p>
<pre class="programlisting">Expression: "(([[:lower:]]+)|([[:upper:]]+))+"
Text: "aBBcccDDDDDeeeeeeee"
** Match found **
Sub-Expressions:
$0 = "aBBcccDDDDDeeeeeeee"
$1 = "eeeeeeee"
$2 = "eeeeeeee"
$3 = "DDDDD"
Captures:
$0 = { "aBBcccDDDDDeeeeeeee" }
$1 = { "a", "BB", "ccc", "DDDDD", "eeeeeeee" }
$2 = { "a", "ccc", "eeeeeeee" }
$3 = { "BB", "DDDDD" }
Expression: "(.*)bar|(.*)bah"
Text: "abcbar"
** Match found **
Sub-Expressions:
$0 = "abcbar"
$1 = "abc"
$2 = ""
Captures:
$0 = { "abcbar" }
$1 = { "abc" }
$2 = { }
Expression: "(.*)bar|(.*)bah"
Text: "abcbah"
** Match found **
Sub-Expressions:
$0 = "abcbah"
$1 = ""
$2 = "abc"
Captures:
$0 = { "abcbah" }
$1 = { }
$2 = { "abc" }
Expression: "^(?:(\w+)|(?&gt;\W+))*$"
Text: "now is the time for all good men to come to the aid of the party"
** Match found **
Sub-Expressions:
$0 = "now is the time for all good men to come to the aid of the party"
$1 = "party"
Captures:
$0 = { "now is the time for all good men to come to the aid of the party" }
$1 = { "now", "is", "the", "time", "for", "all", "good", "men", "to",
"come", "to", "the", "aid", "of", "the", "party" }
</pre>
<p>
Unfortunately enabling this feature has an impact on performance (even if you
don't use it), and a much bigger impact if you do use it, therefore to use
this feature you need to:
</p>
<div class="itemizedlist"><ul class="itemizedlist" style="list-style-type: disc; ">
<li class="listitem">
Define BOOST_REGEX_MATCH_EXTRA for all translation units including the
library source (the best way to do this is to uncomment this define in
boost/regex/user.hpp and then rebuild everything.
</li>
<li class="listitem">
Pass the match_extra flag to the particular algorithms where you actually
need the captures information (regex_search, regex_match, or regex_iterator).
</li>
</ul></div>
</div>
<table xmlns:rev="http://www.cs.rpi.edu/~gregod/boost/tools/doc/revision" width="100%"><tr>
<td align="left"></td>
<td align="right"><div class="copyright-footer">Copyright © 1998-2013 John Maddock<p>
Distributed under the Boost Software License, Version 1.0. (See accompanying
file LICENSE_1_0.txt or copy at <a href="http://www.boost.org/LICENSE_1_0.txt" target="_top">http://www.boost.org/LICENSE_1_0.txt</a>)
</p>
</div></td>
</tr></table>
<hr>
<div class="spirit-nav">
<a accesskey="p" href="unicode.html"><img src="../../../../../doc/src/images/prev.png" alt="Prev"></a><a accesskey="u" href="../index.html"><img src="../../../../../doc/src/images/up.png" alt="Up"></a><a accesskey="h" href="../index.html"><img src="../../../../../doc/src/images/home.png" alt="Home"></a><a accesskey="n" href="partial_matches.html"><img src="../../../../../doc/src/images/next.png" alt="Next"></a>
</div>
</body>
</html>

View File

@ -0,0 +1,51 @@
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title>Configuration</title>
<link rel="stylesheet" href="../../../../../doc/src/boostbook.css" type="text/css">
<meta name="generator" content="DocBook XSL Stylesheets V1.79.1">
<link rel="home" href="../index.html" title="Boost.Regex 7.0.1">
<link rel="up" href="../index.html" title="Boost.Regex 7.0.1">
<link rel="prev" href="../index.html" title="Boost.Regex 7.0.1">
<link rel="next" href="configuration/compiler.html" title="Compiler Setup">
</head>
<body bgcolor="white" text="black" link="#0000FF" vlink="#840084" alink="#0000FF">
<table cellpadding="2" width="100%"><tr>
<td valign="top"><img alt="Boost C++ Libraries" width="277" height="86" src="../../../../../boost.png"></td>
<td align="center"><a href="../../../../../index.html">Home</a></td>
<td align="center"><a href="../../../../../libs/libraries.htm">Libraries</a></td>
<td align="center"><a href="http://www.boost.org/users/people.html">People</a></td>
<td align="center"><a href="http://www.boost.org/users/faq.html">FAQ</a></td>
<td align="center"><a href="../../../../../more/index.htm">More</a></td>
</tr></table>
<hr>
<div class="spirit-nav">
<a accesskey="p" href="../index.html"><img src="../../../../../doc/src/images/prev.png" alt="Prev"></a><a accesskey="u" href="../index.html"><img src="../../../../../doc/src/images/up.png" alt="Up"></a><a accesskey="h" href="../index.html"><img src="../../../../../doc/src/images/home.png" alt="Home"></a><a accesskey="n" href="configuration/compiler.html"><img src="../../../../../doc/src/images/next.png" alt="Next"></a>
</div>
<div class="section">
<div class="titlepage"><div><div><h2 class="title" style="clear: both">
<a name="boost_regex.configuration"></a><a class="link" href="configuration.html" title="Configuration">Configuration</a>
</h2></div></div></div>
<div class="toc"><dl class="toc">
<dt><span class="section"><a href="configuration/compiler.html">Compiler Setup</a></span></dt>
<dt><span class="section"><a href="configuration/standalone.html">Use in Standalone
Mode (without the rest of Boost)</a></span></dt>
<dt><span class="section"><a href="configuration/locale.html">Locale and traits class
selection</a></span></dt>
<dt><span class="section"><a href="configuration/tuning.html">Algorithm Tuning</a></span></dt>
</dl></div>
</div>
<table xmlns:rev="http://www.cs.rpi.edu/~gregod/boost/tools/doc/revision" width="100%"><tr>
<td align="left"></td>
<td align="right"><div class="copyright-footer">Copyright © 1998-2013 John Maddock<p>
Distributed under the Boost Software License, Version 1.0. (See accompanying
file LICENSE_1_0.txt or copy at <a href="http://www.boost.org/LICENSE_1_0.txt" target="_top">http://www.boost.org/LICENSE_1_0.txt</a>)
</p>
</div></td>
</tr></table>
<hr>
<div class="spirit-nav">
<a accesskey="p" href="../index.html"><img src="../../../../../doc/src/images/prev.png" alt="Prev"></a><a accesskey="u" href="../index.html"><img src="../../../../../doc/src/images/up.png" alt="Up"></a><a accesskey="h" href="../index.html"><img src="../../../../../doc/src/images/home.png" alt="Home"></a><a accesskey="n" href="configuration/compiler.html"><img src="../../../../../doc/src/images/next.png" alt="Next"></a>
</div>
</body>
</html>

View File

@ -0,0 +1,93 @@
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title>Algorithm Selection</title>
<link rel="stylesheet" href="../../../../../../doc/src/boostbook.css" type="text/css">
<meta name="generator" content="DocBook XSL Stylesheets V1.79.1">
<link rel="home" href="../../index.html" title="Boost.Regex 5.1.4">
<link rel="up" href="../configuration.html" title="Configuration">
<link rel="prev" href="linkage.html" title="Linkage Options">
<link rel="next" href="tuning.html" title="Algorithm Tuning">
</head>
<body bgcolor="white" text="black" link="#0000FF" vlink="#840084" alink="#0000FF">
<table cellpadding="2" width="100%"><tr>
<td valign="top"><img alt="Boost C++ Libraries" width="277" height="86" src="../../../../../../boost.png"></td>
<td align="center"><a href="../../../../../../index.html">Home</a></td>
<td align="center"><a href="../../../../../../libs/libraries.htm">Libraries</a></td>
<td align="center"><a href="http://www.boost.org/users/people.html">People</a></td>
<td align="center"><a href="http://www.boost.org/users/faq.html">FAQ</a></td>
<td align="center"><a href="../../../../../../more/index.htm">More</a></td>
</tr></table>
<hr>
<div class="spirit-nav">
<a accesskey="p" href="linkage.html"><img src="../../../../../../doc/src/images/prev.png" alt="Prev"></a><a accesskey="u" href="../configuration.html"><img src="../../../../../../doc/src/images/up.png" alt="Up"></a><a accesskey="h" href="../../index.html"><img src="../../../../../../doc/src/images/home.png" alt="Home"></a><a accesskey="n" href="tuning.html"><img src="../../../../../../doc/src/images/next.png" alt="Next"></a>
</div>
<div class="section">
<div class="titlepage"><div><div><h3 class="title">
<a name="boost_regex.configuration.algorithm"></a><a class="link" href="algorithm.html" title="Algorithm Selection">Algorithm Selection</a>
</h3></div></div></div>
<div class="informaltable"><table class="table">
<colgroup>
<col>
<col>
</colgroup>
<thead><tr>
<th>
<p>
macro
</p>
</th>
<th>
<p>
description
</p>
</th>
</tr></thead>
<tbody>
<tr>
<td>
<p>
BOOST_REGEX_RECURSIVE
</p>
</td>
<td>
<p>
Tells Boost.Regex to use a stack-recursive matching algorithm.
This is generally the fastest option (although there is very little
in it), but can cause stack overflow in extreme cases, on Win32
this can be handled safely, but this is not the case on other platforms.
</p>
</td>
</tr>
<tr>
<td>
<p>
BOOST_REGEX_NON_RECURSIVE
</p>
</td>
<td>
<p>
Tells Boost.Regex to use a non-stack recursive matching algorithm,
this can be slightly slower than the alternative, but is always
safe no matter how pathological the regular expression. This is
the default on non-Win32 platforms.
</p>
</td>
</tr>
</tbody>
</table></div>
</div>
<table xmlns:rev="http://www.cs.rpi.edu/~gregod/boost/tools/doc/revision" width="100%"><tr>
<td align="left"></td>
<td align="right"><div class="copyright-footer">Copyright © 1998-2013 John Maddock<p>
Distributed under the Boost Software License, Version 1.0. (See accompanying
file LICENSE_1_0.txt or copy at <a href="http://www.boost.org/LICENSE_1_0.txt" target="_top">http://www.boost.org/LICENSE_1_0.txt</a>)
</p>
</div></td>
</tr></table>
<hr>
<div class="spirit-nav">
<a accesskey="p" href="linkage.html"><img src="../../../../../../doc/src/images/prev.png" alt="Prev"></a><a accesskey="u" href="../configuration.html"><img src="../../../../../../doc/src/images/up.png" alt="Up"></a><a accesskey="h" href="../../index.html"><img src="../../../../../../doc/src/images/home.png" alt="Home"></a><a accesskey="n" href="tuning.html"><img src="../../../../../../doc/src/images/next.png" alt="Next"></a>
</div>
</body>
</html>

View File

@ -0,0 +1,50 @@
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title>Compiler Setup</title>
<link rel="stylesheet" href="../../../../../../doc/src/boostbook.css" type="text/css">
<meta name="generator" content="DocBook XSL Stylesheets V1.79.1">
<link rel="home" href="../../index.html" title="Boost.Regex 7.0.1">
<link rel="up" href="../configuration.html" title="Configuration">
<link rel="prev" href="../configuration.html" title="Configuration">
<link rel="next" href="standalone.html" title="Use in Standalone Mode (without the rest of Boost)">
</head>
<body bgcolor="white" text="black" link="#0000FF" vlink="#840084" alink="#0000FF">
<table cellpadding="2" width="100%"><tr>
<td valign="top"><img alt="Boost C++ Libraries" width="277" height="86" src="../../../../../../boost.png"></td>
<td align="center"><a href="../../../../../../index.html">Home</a></td>
<td align="center"><a href="../../../../../../libs/libraries.htm">Libraries</a></td>
<td align="center"><a href="http://www.boost.org/users/people.html">People</a></td>
<td align="center"><a href="http://www.boost.org/users/faq.html">FAQ</a></td>
<td align="center"><a href="../../../../../../more/index.htm">More</a></td>
</tr></table>
<hr>
<div class="spirit-nav">
<a accesskey="p" href="../configuration.html"><img src="../../../../../../doc/src/images/prev.png" alt="Prev"></a><a accesskey="u" href="../configuration.html"><img src="../../../../../../doc/src/images/up.png" alt="Up"></a><a accesskey="h" href="../../index.html"><img src="../../../../../../doc/src/images/home.png" alt="Home"></a><a accesskey="n" href="standalone.html"><img src="../../../../../../doc/src/images/next.png" alt="Next"></a>
</div>
<div class="section">
<div class="titlepage"><div><div><h3 class="title">
<a name="boost_regex.configuration.compiler"></a><a class="link" href="compiler.html" title="Compiler Setup">Compiler Setup</a>
</h3></div></div></div>
<p>
You shouldn't need to do anything special to configure Boost.Regex for use
with your compiler - the <a href="../../../../../config/index.html" target="_top">Boost.Config
subsystem</a> should already take care of it, if you do have problems
(or you are using a particularly obscure compiler or platform) then <a href="../../../../../config/index.html" target="_top">Boost.Config</a> has a configure script
that you can run.
</p>
</div>
<table xmlns:rev="http://www.cs.rpi.edu/~gregod/boost/tools/doc/revision" width="100%"><tr>
<td align="left"></td>
<td align="right"><div class="copyright-footer">Copyright © 1998-2013 John Maddock<p>
Distributed under the Boost Software License, Version 1.0. (See accompanying
file LICENSE_1_0.txt or copy at <a href="http://www.boost.org/LICENSE_1_0.txt" target="_top">http://www.boost.org/LICENSE_1_0.txt</a>)
</p>
</div></td>
</tr></table>
<hr>
<div class="spirit-nav">
<a accesskey="p" href="../configuration.html"><img src="../../../../../../doc/src/images/prev.png" alt="Prev"></a><a accesskey="u" href="../configuration.html"><img src="../../../../../../doc/src/images/up.png" alt="Up"></a><a accesskey="h" href="../../index.html"><img src="../../../../../../doc/src/images/home.png" alt="Home"></a><a accesskey="n" href="standalone.html"><img src="../../../../../../doc/src/images/next.png" alt="Next"></a>
</div>
</body>
</html>

View File

@ -0,0 +1,106 @@
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title>Linkage Options</title>
<link rel="stylesheet" href="../../../../../../doc/src/boostbook.css" type="text/css">
<meta name="generator" content="DocBook XSL Stylesheets V1.79.1">
<link rel="home" href="../../index.html" title="Boost.Regex 5.1.4">
<link rel="up" href="../configuration.html" title="Configuration">
<link rel="prev" href="locale.html" title="Locale and traits class selection">
<link rel="next" href="algorithm.html" title="Algorithm Selection">
</head>
<body bgcolor="white" text="black" link="#0000FF" vlink="#840084" alink="#0000FF">
<table cellpadding="2" width="100%"><tr>
<td valign="top"><img alt="Boost C++ Libraries" width="277" height="86" src="../../../../../../boost.png"></td>
<td align="center"><a href="../../../../../../index.html">Home</a></td>
<td align="center"><a href="../../../../../../libs/libraries.htm">Libraries</a></td>
<td align="center"><a href="http://www.boost.org/users/people.html">People</a></td>
<td align="center"><a href="http://www.boost.org/users/faq.html">FAQ</a></td>
<td align="center"><a href="../../../../../../more/index.htm">More</a></td>
</tr></table>
<hr>
<div class="spirit-nav">
<a accesskey="p" href="locale.html"><img src="../../../../../../doc/src/images/prev.png" alt="Prev"></a><a accesskey="u" href="../configuration.html"><img src="../../../../../../doc/src/images/up.png" alt="Up"></a><a accesskey="h" href="../../index.html"><img src="../../../../../../doc/src/images/home.png" alt="Home"></a><a accesskey="n" href="algorithm.html"><img src="../../../../../../doc/src/images/next.png" alt="Next"></a>
</div>
<div class="section">
<div class="titlepage"><div><div><h3 class="title">
<a name="boost_regex.configuration.linkage"></a><a class="link" href="linkage.html" title="Linkage Options">Linkage Options</a>
</h3></div></div></div>
<div class="informaltable"><table class="table">
<colgroup>
<col>
<col>
</colgroup>
<thead><tr>
<th>
<p>
macro
</p>
</th>
<th>
<p>
description
</p>
</th>
</tr></thead>
<tbody>
<tr>
<td>
<p>
BOOST_REGEX_DYN_LINK
</p>
</td>
<td>
<p>
For Microsoft and Borland C++ builds, this tells Boost.Regex that
it should link to the dll build of the Boost.Regex. By default
boost.regex will link to its static library build, even if the
dynamic C runtime library is in use.
</p>
</td>
</tr>
<tr>
<td>
<p>
BOOST_REGEX_NO_LIB
</p>
</td>
<td>
<p>
For Microsoft and Borland C++ builds, this tells Boost.Regex that
it should not automatically select the library to link to.
</p>
</td>
</tr>
<tr>
<td>
<p>
BOOST_REGEX_NO_FASTCALL
</p>
</td>
<td>
<p>
For Microsoft builds, this tells Boost.Regex to use the <code class="computeroutput"><span class="identifier">__cdecl</span></code> calling convention rather
than <code class="computeroutput"><span class="identifier">__fastcall</span></code>.
Useful if you want to use the same library from both managed and
unmanaged code.
</p>
</td>
</tr>
</tbody>
</table></div>
</div>
<table xmlns:rev="http://www.cs.rpi.edu/~gregod/boost/tools/doc/revision" width="100%"><tr>
<td align="left"></td>
<td align="right"><div class="copyright-footer">Copyright © 1998-2013 John Maddock<p>
Distributed under the Boost Software License, Version 1.0. (See accompanying
file LICENSE_1_0.txt or copy at <a href="http://www.boost.org/LICENSE_1_0.txt" target="_top">http://www.boost.org/LICENSE_1_0.txt</a>)
</p>
</div></td>
</tr></table>
<hr>
<div class="spirit-nav">
<a accesskey="p" href="locale.html"><img src="../../../../../../doc/src/images/prev.png" alt="Prev"></a><a accesskey="u" href="../configuration.html"><img src="../../../../../../doc/src/images/up.png" alt="Up"></a><a accesskey="h" href="../../index.html"><img src="../../../../../../doc/src/images/home.png" alt="Home"></a><a accesskey="n" href="algorithm.html"><img src="../../../../../../doc/src/images/next.png" alt="Next"></a>
</div>
</body>
</html>

View File

@ -0,0 +1,109 @@
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title>Locale and traits class selection</title>
<link rel="stylesheet" href="../../../../../../doc/src/boostbook.css" type="text/css">
<meta name="generator" content="DocBook XSL Stylesheets V1.79.1">
<link rel="home" href="../../index.html" title="Boost.Regex 7.0.1">
<link rel="up" href="../configuration.html" title="Configuration">
<link rel="prev" href="standalone.html" title="Use in Standalone Mode (without the rest of Boost)">
<link rel="next" href="tuning.html" title="Algorithm Tuning">
</head>
<body bgcolor="white" text="black" link="#0000FF" vlink="#840084" alink="#0000FF">
<table cellpadding="2" width="100%"><tr>
<td valign="top"><img alt="Boost C++ Libraries" width="277" height="86" src="../../../../../../boost.png"></td>
<td align="center"><a href="../../../../../../index.html">Home</a></td>
<td align="center"><a href="../../../../../../libs/libraries.htm">Libraries</a></td>
<td align="center"><a href="http://www.boost.org/users/people.html">People</a></td>
<td align="center"><a href="http://www.boost.org/users/faq.html">FAQ</a></td>
<td align="center"><a href="../../../../../../more/index.htm">More</a></td>
</tr></table>
<hr>
<div class="spirit-nav">
<a accesskey="p" href="standalone.html"><img src="../../../../../../doc/src/images/prev.png" alt="Prev"></a><a accesskey="u" href="../configuration.html"><img src="../../../../../../doc/src/images/up.png" alt="Up"></a><a accesskey="h" href="../../index.html"><img src="../../../../../../doc/src/images/home.png" alt="Home"></a><a accesskey="n" href="tuning.html"><img src="../../../../../../doc/src/images/next.png" alt="Next"></a>
</div>
<div class="section">
<div class="titlepage"><div><div><h3 class="title">
<a name="boost_regex.configuration.locale"></a><a class="link" href="locale.html" title="Locale and traits class selection">Locale and traits class
selection</a>
</h3></div></div></div>
<p>
The following macros (see <a href="../../../../../../boost/regex/user.hpp" target="_top">user.hpp</a>)
control how Boost.Regex interacts with the user's locale:
</p>
<div class="informaltable"><table class="table">
<colgroup>
<col>
<col>
</colgroup>
<thead><tr>
<th>
<p>
macro
</p>
</th>
<th>
<p>
description
</p>
</th>
</tr></thead>
<tbody>
<tr>
<td>
<p>
BOOST_REGEX_USE_C_LOCALE
</p>
</td>
<td>
<p>
Forces Boost.Regex to use the global C locale in its traits class
support: this is now deprecated in favour of the C++ locale.
</p>
</td>
</tr>
<tr>
<td>
<p>
BOOST_REGEX_USE_CPP_LOCALE
</p>
</td>
<td>
<p>
Forces Boost.Regex to use std::locale in it's default traits class,
regular expressions can then be imbued with an instance specific
locale. This is the default behaviour on non-Windows platforms.
</p>
</td>
</tr>
<tr>
<td>
<p>
BOOST_REGEX_NO_W32
</p>
</td>
<td>
<p>
Tells Boost.Regex not to use any Win32 API's even when available
(implies BOOST_REGEX_USE_CPP_LOCALE unless BOOST_REGEX_USE_C_LOCALE
is set).
</p>
</td>
</tr>
</tbody>
</table></div>
</div>
<table xmlns:rev="http://www.cs.rpi.edu/~gregod/boost/tools/doc/revision" width="100%"><tr>
<td align="left"></td>
<td align="right"><div class="copyright-footer">Copyright © 1998-2013 John Maddock<p>
Distributed under the Boost Software License, Version 1.0. (See accompanying
file LICENSE_1_0.txt or copy at <a href="http://www.boost.org/LICENSE_1_0.txt" target="_top">http://www.boost.org/LICENSE_1_0.txt</a>)
</p>
</div></td>
</tr></table>
<hr>
<div class="spirit-nav">
<a accesskey="p" href="standalone.html"><img src="../../../../../../doc/src/images/prev.png" alt="Prev"></a><a accesskey="u" href="../configuration.html"><img src="../../../../../../doc/src/images/up.png" alt="Up"></a><a accesskey="h" href="../../index.html"><img src="../../../../../../doc/src/images/home.png" alt="Home"></a><a accesskey="n" href="tuning.html"><img src="../../../../../../doc/src/images/next.png" alt="Next"></a>
</div>
</body>
</html>

View File

@ -0,0 +1,118 @@
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title>Algorithm Tuning</title>
<link rel="stylesheet" href="../../../../../../doc/src/boostbook.css" type="text/css">
<meta name="generator" content="DocBook XSL Stylesheets V1.79.1">
<link rel="home" href="../../index.html" title="Boost.Regex 7.0.1">
<link rel="up" href="../configuration.html" title="Configuration">
<link rel="prev" href="locale.html" title="Locale and traits class selection">
<link rel="next" href="../install.html" title="Building and Installing the Library">
</head>
<body bgcolor="white" text="black" link="#0000FF" vlink="#840084" alink="#0000FF">
<table cellpadding="2" width="100%"><tr>
<td valign="top"><img alt="Boost C++ Libraries" width="277" height="86" src="../../../../../../boost.png"></td>
<td align="center"><a href="../../../../../../index.html">Home</a></td>
<td align="center"><a href="../../../../../../libs/libraries.htm">Libraries</a></td>
<td align="center"><a href="http://www.boost.org/users/people.html">People</a></td>
<td align="center"><a href="http://www.boost.org/users/faq.html">FAQ</a></td>
<td align="center"><a href="../../../../../../more/index.htm">More</a></td>
</tr></table>
<hr>
<div class="spirit-nav">
<a accesskey="p" href="locale.html"><img src="../../../../../../doc/src/images/prev.png" alt="Prev"></a><a accesskey="u" href="../configuration.html"><img src="../../../../../../doc/src/images/up.png" alt="Up"></a><a accesskey="h" href="../../index.html"><img src="../../../../../../doc/src/images/home.png" alt="Home"></a><a accesskey="n" href="../install.html"><img src="../../../../../../doc/src/images/next.png" alt="Next"></a>
</div>
<div class="section">
<div class="titlepage"><div><div><h3 class="title">
<a name="boost_regex.configuration.tuning"></a><a class="link" href="tuning.html" title="Algorithm Tuning">Algorithm Tuning</a>
</h3></div></div></div>
<div class="informaltable"><table class="table">
<colgroup>
<col>
<col>
</colgroup>
<thead><tr>
<th>
<p>
macro
</p>
</th>
<th>
<p>
description
</p>
</th>
</tr></thead>
<tbody>
<tr>
<td>
<p>
BOOST_REGEX_BLOCKSIZE
</p>
</td>
<td>
<p>
Boost.Regex uses largish blocks of memory to act as a stack for
the state machine, the larger the block size then the fewer allocations
that will take place. This defaults to 4096 bytes, which is large
enough to match the vast majority of regular expressions without
further allocations, however, you can choose smaller or larger
values depending upon your platforms characteristics.
</p>
</td>
</tr>
<tr>
<td>
<p>
BOOST_REGEX_MAX_BLOCKS
</p>
</td>
<td>
<p>
Tells Boost.Regex how many blocks of size BOOST_REGEX_BLOCKSIZE
it is permitted to use. If this value is exceeded then Boost.Regex
will stop trying to find a match and throw a std::runtime_error.
Defaults to 1024, don't forget to tweak this value if you alter
BOOST_REGEX_BLOCKSIZE by much.
</p>
</td>
</tr>
<tr>
<td>
<p>
BOOST_REGEX_MAX_CACHE_BLOCKS
</p>
</td>
<td>
<p>
Tells Boost.Regex how many memory blocks to store in it's internal
cache - memory blocks are taken from this cache rather than by
calling ::operator new. Generally speaking this can be an order
of magnitude faster than calling ::opertator new each time a memory
block is required, but has the downside that Boost.Regex can end
up caching a large chunk of memory (by default up to 16 blocks
each of BOOST_REGEX_BLOCKSIZE size). If memory is tight then try
defining this to 0 (disables all caching), or if that is too slow,
then a value of 1 or 2, may be sufficient. On the other hand, on
large multi-processor, multi-threaded systems, you may find that
a higher value is in order.
</p>
</td>
</tr>
</tbody>
</table></div>
</div>
<table xmlns:rev="http://www.cs.rpi.edu/~gregod/boost/tools/doc/revision" width="100%"><tr>
<td align="left"></td>
<td align="right"><div class="copyright-footer">Copyright © 1998-2013 John Maddock<p>
Distributed under the Boost Software License, Version 1.0. (See accompanying
file LICENSE_1_0.txt or copy at <a href="http://www.boost.org/LICENSE_1_0.txt" target="_top">http://www.boost.org/LICENSE_1_0.txt</a>)
</p>
</div></td>
</tr></table>
<hr>
<div class="spirit-nav">
<a accesskey="p" href="locale.html"><img src="../../../../../../doc/src/images/prev.png" alt="Prev"></a><a accesskey="u" href="../configuration.html"><img src="../../../../../../doc/src/images/up.png" alt="Up"></a><a accesskey="h" href="../../index.html"><img src="../../../../../../doc/src/images/home.png" alt="Home"></a><a accesskey="n" href="../install.html"><img src="../../../../../../doc/src/images/next.png" alt="Next"></a>
</div>
</body>
</html>

View File

@ -0,0 +1,62 @@
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title>Search and Replace Format String Syntax</title>
<link rel="stylesheet" href="../../../../../doc/src/boostbook.css" type="text/css">
<meta name="generator" content="DocBook XSL Stylesheets V1.79.1">
<link rel="home" href="../index.html" title="Boost.Regex 7.0.1">
<link rel="up" href="../index.html" title="Boost.Regex 7.0.1">
<link rel="prev" href="syntax/leftmost_longest_rule.html" title="The Leftmost Longest Rule">
<link rel="next" href="format/sed_format.html" title="Sed Format String Syntax">
</head>
<body bgcolor="white" text="black" link="#0000FF" vlink="#840084" alink="#0000FF">
<table cellpadding="2" width="100%"><tr>
<td valign="top"><img alt="Boost C++ Libraries" width="277" height="86" src="../../../../../boost.png"></td>
<td align="center"><a href="../../../../../index.html">Home</a></td>
<td align="center"><a href="../../../../../libs/libraries.htm">Libraries</a></td>
<td align="center"><a href="http://www.boost.org/users/people.html">People</a></td>
<td align="center"><a href="http://www.boost.org/users/faq.html">FAQ</a></td>
<td align="center"><a href="../../../../../more/index.htm">More</a></td>
</tr></table>
<hr>
<div class="spirit-nav">
<a accesskey="p" href="syntax/leftmost_longest_rule.html"><img src="../../../../../doc/src/images/prev.png" alt="Prev"></a><a accesskey="u" href="../index.html"><img src="../../../../../doc/src/images/up.png" alt="Up"></a><a accesskey="h" href="../index.html"><img src="../../../../../doc/src/images/home.png" alt="Home"></a><a accesskey="n" href="format/sed_format.html"><img src="../../../../../doc/src/images/next.png" alt="Next"></a>
</div>
<div class="section">
<div class="titlepage"><div><div><h2 class="title" style="clear: both">
<a name="boost_regex.format"></a><a class="link" href="format.html" title="Search and Replace Format String Syntax">Search and Replace Format String Syntax</a>
</h2></div></div></div>
<div class="toc"><dl class="toc">
<dt><span class="section"><a href="format/sed_format.html">Sed Format String Syntax</a></span></dt>
<dt><span class="section"><a href="format/perl_format.html">Perl Format String Syntax</a></span></dt>
<dt><span class="section"><a href="format/boost_format_syntax.html">Boost-Extended
Format String Syntax</a></span></dt>
</dl></div>
<p>
Format strings are used by the algorithm <a class="link" href="ref/regex_replace.html" title="regex_replace"><code class="computeroutput"><span class="identifier">regex_replace</span></code></a> and by <a class="link" href="ref/match_results.html#boost_regex.match_results_format"><code class="computeroutput"><span class="identifier">match_results</span><span class="special">&lt;&gt;::</span><span class="identifier">format</span></code></a>, and are used to transform
one string into another.
</p>
<p>
There are three kind of format string: <a class="link" href="format/sed_format.html" title="Sed Format String Syntax">Sed</a>,
<a class="link" href="format/perl_format.html" title="Perl Format String Syntax">Perl</a> and <a class="link" href="format/boost_format_syntax.html" title="Boost-Extended Format String Syntax">Boost-Extended</a>.
</p>
<p>
Alternatively, when the flag <code class="computeroutput"><span class="identifier">format_literal</span></code>
is passed to one of these functions, then the format string is treated as a
string literal, and is copied unchanged to the output.
</p>
</div>
<table xmlns:rev="http://www.cs.rpi.edu/~gregod/boost/tools/doc/revision" width="100%"><tr>
<td align="left"></td>
<td align="right"><div class="copyright-footer">Copyright © 1998-2013 John Maddock<p>
Distributed under the Boost Software License, Version 1.0. (See accompanying
file LICENSE_1_0.txt or copy at <a href="http://www.boost.org/LICENSE_1_0.txt" target="_top">http://www.boost.org/LICENSE_1_0.txt</a>)
</p>
</div></td>
</tr></table>
<hr>
<div class="spirit-nav">
<a accesskey="p" href="syntax/leftmost_longest_rule.html"><img src="../../../../../doc/src/images/prev.png" alt="Prev"></a><a accesskey="u" href="../index.html"><img src="../../../../../doc/src/images/up.png" alt="Up"></a><a accesskey="h" href="../index.html"><img src="../../../../../doc/src/images/home.png" alt="Home"></a><a accesskey="n" href="format/sed_format.html"><img src="../../../../../doc/src/images/next.png" alt="Next"></a>
</div>
</body>
</html>

View File

@ -0,0 +1,561 @@
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title>Boost-Extended Format String Syntax</title>
<link rel="stylesheet" href="../../../../../../doc/src/boostbook.css" type="text/css">
<meta name="generator" content="DocBook XSL Stylesheets V1.79.1">
<link rel="home" href="../../index.html" title="Boost.Regex 7.0.1">
<link rel="up" href="../format.html" title="Search and Replace Format String Syntax">
<link rel="prev" href="perl_format.html" title="Perl Format String Syntax">
<link rel="next" href="../ref.html" title="Reference">
</head>
<body bgcolor="white" text="black" link="#0000FF" vlink="#840084" alink="#0000FF">
<table cellpadding="2" width="100%"><tr>
<td valign="top"><img alt="Boost C++ Libraries" width="277" height="86" src="../../../../../../boost.png"></td>
<td align="center"><a href="../../../../../../index.html">Home</a></td>
<td align="center"><a href="../../../../../../libs/libraries.htm">Libraries</a></td>
<td align="center"><a href="http://www.boost.org/users/people.html">People</a></td>
<td align="center"><a href="http://www.boost.org/users/faq.html">FAQ</a></td>
<td align="center"><a href="../../../../../../more/index.htm">More</a></td>
</tr></table>
<hr>
<div class="spirit-nav">
<a accesskey="p" href="perl_format.html"><img src="../../../../../../doc/src/images/prev.png" alt="Prev"></a><a accesskey="u" href="../format.html"><img src="../../../../../../doc/src/images/up.png" alt="Up"></a><a accesskey="h" href="../../index.html"><img src="../../../../../../doc/src/images/home.png" alt="Home"></a><a accesskey="n" href="../ref.html"><img src="../../../../../../doc/src/images/next.png" alt="Next"></a>
</div>
<div class="section">
<div class="titlepage"><div><div><h3 class="title">
<a name="boost_regex.format.boost_format_syntax"></a><a class="link" href="boost_format_syntax.html" title="Boost-Extended Format String Syntax">Boost-Extended
Format String Syntax</a>
</h3></div></div></div>
<p>
Boost-Extended format strings treat all characters as literals except for
'$', '\', '(', ')', '?', and ':'.
</p>
<h5>
<a name="boost_regex.format.boost_format_syntax.h0"></a>
<span class="phrase"><a name="boost_regex.format.boost_format_syntax.grouping"></a></span><a class="link" href="boost_format_syntax.html#boost_regex.format.boost_format_syntax.grouping">Grouping</a>
</h5>
<p>
The characters '(' and ')' perform lexical grouping, so use \( and \) if
you want a to output literal parenthesis.
</p>
<h5>
<a name="boost_regex.format.boost_format_syntax.h1"></a>
<span class="phrase"><a name="boost_regex.format.boost_format_syntax.conditionals"></a></span><a class="link" href="boost_format_syntax.html#boost_regex.format.boost_format_syntax.conditionals">Conditionals</a>
</h5>
<p>
The character '?' begins a conditional expression, the general form is:
</p>
<p>
?Ntrue-expression:false-expression
</p>
<p>
where N is decimal digit.
</p>
<p>
If sub-expression N was matched, then true-expression is evaluated and sent
to output, otherwise false-expression is evaluated and sent to output.
</p>
<p>
You will normally need to surround a conditional-expression with parenthesis
in order to prevent ambiguities.
</p>
<p>
For example, the format string "(?1foo:bar)" will replace each
match found with "foo" if the sub-expression $1 was matched, and
with "bar" otherwise.
</p>
<p>
For sub-expressions with an index greater than 9, or for access to named
sub-expressions use:
</p>
<p>
?{INDEX}true-expression:false-expression
</p>
<p>
or
</p>
<p>
?{NAME}true-expression:false-expression
</p>
<h5>
<a name="boost_regex.format.boost_format_syntax.h2"></a>
<span class="phrase"><a name="boost_regex.format.boost_format_syntax.placeholder_sequences"></a></span><a class="link" href="boost_format_syntax.html#boost_regex.format.boost_format_syntax.placeholder_sequences">Placeholder
Sequences</a>
</h5>
<p>
Placeholder sequences specify that some part of what matched the regular
expression should be sent to output as follows:
</p>
<div class="informaltable"><table class="table">
<colgroup>
<col>
<col>
</colgroup>
<thead><tr>
<th>
<p>
Placeholder
</p>
</th>
<th>
<p>
Meaning
</p>
</th>
</tr></thead>
<tbody>
<tr>
<td>
<p>
$&amp;
</p>
</td>
<td>
<p>
Outputs what matched the whole expression.
</p>
</td>
</tr>
<tr>
<td>
<p>
$MATCH
</p>
</td>
<td>
<p>
As $&amp;
</p>
</td>
</tr>
<tr>
<td>
<p>
${^MATCH}
</p>
</td>
<td>
<p>
As $&amp;
</p>
</td>
</tr>
<tr>
<td>
<p>
$`
</p>
</td>
<td>
<p>
Outputs the text between the end of the last match found (or the
start of the text if no previous match was found), and the start
of the current match.
</p>
</td>
</tr>
<tr>
<td>
<p>
$PREMATCH
</p>
</td>
<td>
<p>
As $`
</p>
</td>
</tr>
<tr>
<td>
<p>
${^PREMATCH}
</p>
</td>
<td>
<p>
As $`
</p>
</td>
</tr>
<tr>
<td>
<p>
$'
</p>
</td>
<td>
<p>
Outputs all the text following the end of the current match.
</p>
</td>
</tr>
<tr>
<td>
<p>
$POSTMATCH
</p>
</td>
<td>
<p>
As $'
</p>
</td>
</tr>
<tr>
<td>
<p>
${^POSTMATCH}
</p>
</td>
<td>
<p>
As $'
</p>
</td>
</tr>
<tr>
<td>
<p>
$+
</p>
</td>
<td>
<p>
Outputs what matched the last marked sub-expression in the regular
expression.
</p>
</td>
</tr>
<tr>
<td>
<p>
$LAST_PAREN_MATCH
</p>
</td>
<td>
<p>
As $+
</p>
</td>
</tr>
<tr>
<td>
<p>
$LAST_SUBMATCH_RESULT
</p>
</td>
<td>
<p>
Outputs what matched the last sub-expression to be actually matched.
</p>
</td>
</tr>
<tr>
<td>
<p>
$^N
</p>
</td>
<td>
<p>
As $LAST_SUBMATCH_RESULT
</p>
</td>
</tr>
<tr>
<td>
<p>
$$
</p>
</td>
<td>
<p>
Outputs a literal '$'
</p>
</td>
</tr>
<tr>
<td>
<p>
$n
</p>
</td>
<td>
<p>
Outputs what matched the n'th sub-expression.
</p>
</td>
</tr>
<tr>
<td>
<p>
${n}
</p>
</td>
<td>
<p>
Outputs what matched the n'th sub-expression.
</p>
</td>
</tr>
<tr>
<td>
<p>
$+{NAME}
</p>
</td>
<td>
<p>
Outputs whatever matched the sub-expression named "NAME".
</p>
</td>
</tr>
</tbody>
</table></div>
<p>
Any $-placeholder sequence not listed above, results in '$' being treated
as a literal.
</p>
<h5>
<a name="boost_regex.format.boost_format_syntax.h3"></a>
<span class="phrase"><a name="boost_regex.format.boost_format_syntax.escape_sequences"></a></span><a class="link" href="boost_format_syntax.html#boost_regex.format.boost_format_syntax.escape_sequences">Escape
Sequences</a>
</h5>
<p>
An escape character followed by any character x, outputs that character unless
x is one of the escape sequences shown below.
</p>
<div class="informaltable"><table class="table">
<colgroup>
<col>
<col>
</colgroup>
<thead><tr>
<th>
<p>
Escape
</p>
</th>
<th>
<p>
Meaning
</p>
</th>
</tr></thead>
<tbody>
<tr>
<td>
<p>
\a
</p>
</td>
<td>
<p>
Outputs the bell character: '\a'.
</p>
</td>
</tr>
<tr>
<td>
<p>
\e
</p>
</td>
<td>
<p>
Outputs the ANSI escape character (code point 27).
</p>
</td>
</tr>
<tr>
<td>
<p>
\f
</p>
</td>
<td>
<p>
Outputs a form feed character: '\f'
</p>
</td>
</tr>
<tr>
<td>
<p>
\n
</p>
</td>
<td>
<p>
Outputs a newline character: '\n'.
</p>
</td>
</tr>
<tr>
<td>
<p>
\r
</p>
</td>
<td>
<p>
Outputs a carriage return character: '\r'.
</p>
</td>
</tr>
<tr>
<td>
<p>
\t
</p>
</td>
<td>
<p>
Outputs a tab character: '\t'.
</p>
</td>
</tr>
<tr>
<td>
<p>
\v
</p>
</td>
<td>
<p>
Outputs a vertical tab character: '\v'.
</p>
</td>
</tr>
<tr>
<td>
<p>
\xDD
</p>
</td>
<td>
<p>
Outputs the character whose hexadecimal code point is 0xDD
</p>
</td>
</tr>
<tr>
<td>
<p>
\x{DDDD}
</p>
</td>
<td>
<p>
Outputs the character whose hexadecimal code point is 0xDDDDD
</p>
</td>
</tr>
<tr>
<td>
<p>
\cX
</p>
</td>
<td>
<p>
Outputs the ANSI escape sequence "escape-X".
</p>
</td>
</tr>
<tr>
<td>
<p>
\D
</p>
</td>
<td>
<p>
If D is a decimal digit in the range 1-9, then outputs the text
that matched sub-expression D.
</p>
</td>
</tr>
<tr>
<td>
<p>
\l
</p>
</td>
<td>
<p>
Causes the next character to be outputted, to be output in lower
case.
</p>
</td>
</tr>
<tr>
<td>
<p>
\u
</p>
</td>
<td>
<p>
Causes the next character to be outputted, to be output in upper
case.
</p>
</td>
</tr>
<tr>
<td>
<p>
\L
</p>
</td>
<td>
<p>
Causes all subsequent characters to be output in lower case, until
a \E is found.
</p>
</td>
</tr>
<tr>
<td>
<p>
\U
</p>
</td>
<td>
<p>
Causes all subsequent characters to be output in upper case, until
a \E is found.
</p>
</td>
</tr>
<tr>
<td>
<p>
\E
</p>
</td>
<td>
<p>
Terminates a \L or \U sequence.
</p>
</td>
</tr>
</tbody>
</table></div>
</div>
<table xmlns:rev="http://www.cs.rpi.edu/~gregod/boost/tools/doc/revision" width="100%"><tr>
<td align="left"></td>
<td align="right"><div class="copyright-footer">Copyright © 1998-2013 John Maddock<p>
Distributed under the Boost Software License, Version 1.0. (See accompanying
file LICENSE_1_0.txt or copy at <a href="http://www.boost.org/LICENSE_1_0.txt" target="_top">http://www.boost.org/LICENSE_1_0.txt</a>)
</p>
</div></td>
</tr></table>
<hr>
<div class="spirit-nav">
<a accesskey="p" href="perl_format.html"><img src="../../../../../../doc/src/images/prev.png" alt="Prev"></a><a accesskey="u" href="../format.html"><img src="../../../../../../doc/src/images/up.png" alt="Up"></a><a accesskey="h" href="../../index.html"><img src="../../../../../../doc/src/images/home.png" alt="Home"></a><a accesskey="n" href="../ref.html"><img src="../../../../../../doc/src/images/next.png" alt="Next"></a>
</div>
</body>
</html>

View File

@ -0,0 +1,503 @@
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title>Perl Format String Syntax</title>
<link rel="stylesheet" href="../../../../../../doc/src/boostbook.css" type="text/css">
<meta name="generator" content="DocBook XSL Stylesheets V1.79.1">
<link rel="home" href="../../index.html" title="Boost.Regex 7.0.1">
<link rel="up" href="../format.html" title="Search and Replace Format String Syntax">
<link rel="prev" href="sed_format.html" title="Sed Format String Syntax">
<link rel="next" href="boost_format_syntax.html" title="Boost-Extended Format String Syntax">
</head>
<body bgcolor="white" text="black" link="#0000FF" vlink="#840084" alink="#0000FF">
<table cellpadding="2" width="100%"><tr>
<td valign="top"><img alt="Boost C++ Libraries" width="277" height="86" src="../../../../../../boost.png"></td>
<td align="center"><a href="../../../../../../index.html">Home</a></td>
<td align="center"><a href="../../../../../../libs/libraries.htm">Libraries</a></td>
<td align="center"><a href="http://www.boost.org/users/people.html">People</a></td>
<td align="center"><a href="http://www.boost.org/users/faq.html">FAQ</a></td>
<td align="center"><a href="../../../../../../more/index.htm">More</a></td>
</tr></table>
<hr>
<div class="spirit-nav">
<a accesskey="p" href="sed_format.html"><img src="../../../../../../doc/src/images/prev.png" alt="Prev"></a><a accesskey="u" href="../format.html"><img src="../../../../../../doc/src/images/up.png" alt="Up"></a><a accesskey="h" href="../../index.html"><img src="../../../../../../doc/src/images/home.png" alt="Home"></a><a accesskey="n" href="boost_format_syntax.html"><img src="../../../../../../doc/src/images/next.png" alt="Next"></a>
</div>
<div class="section">
<div class="titlepage"><div><div><h3 class="title">
<a name="boost_regex.format.perl_format"></a><a class="link" href="perl_format.html" title="Perl Format String Syntax">Perl Format String Syntax</a>
</h3></div></div></div>
<p>
Perl-style format strings treat all characters as literals except '$' and
'\' which start placeholder and escape sequences respectively.
</p>
<p>
Placeholder sequences specify that some part of what matched the regular
expression should be sent to output as follows:
</p>
<div class="informaltable"><table class="table">
<colgroup>
<col>
<col>
</colgroup>
<thead><tr>
<th>
<p>
Placeholder
</p>
</th>
<th>
<p>
Meaning
</p>
</th>
</tr></thead>
<tbody>
<tr>
<td>
<p>
$&amp;
</p>
</td>
<td>
<p>
Outputs what matched the whole expression.
</p>
</td>
</tr>
<tr>
<td>
<p>
$MATCH
</p>
</td>
<td>
<p>
As $&amp;
</p>
</td>
</tr>
<tr>
<td>
<p>
${^MATCH}
</p>
</td>
<td>
<p>
As $&amp;
</p>
</td>
</tr>
<tr>
<td>
<p>
$`
</p>
</td>
<td>
<p>
Outputs the text between the end of the last match found (or the
start of the text if no previous match was found), and the start
of the current match.
</p>
</td>
</tr>
<tr>
<td>
<p>
$PREMATCH
</p>
</td>
<td>
<p>
As $`
</p>
</td>
</tr>
<tr>
<td>
<p>
${^PREMATCH}
</p>
</td>
<td>
<p>
As $`
</p>
</td>
</tr>
<tr>
<td>
<p>
$'
</p>
</td>
<td>
<p>
Outputs all the text following the end of the current match.
</p>
</td>
</tr>
<tr>
<td>
<p>
$POSTMATCH
</p>
</td>
<td>
<p>
As $'
</p>
</td>
</tr>
<tr>
<td>
<p>
${^POSTMATCH}
</p>
</td>
<td>
<p>
As $'
</p>
</td>
</tr>
<tr>
<td>
<p>
$+
</p>
</td>
<td>
<p>
Outputs what matched the last marked sub-expression in the regular
expression.
</p>
</td>
</tr>
<tr>
<td>
<p>
$LAST_PAREN_MATCH
</p>
</td>
<td>
<p>
As $+
</p>
</td>
</tr>
<tr>
<td>
<p>
$LAST_SUBMATCH_RESULT
</p>
</td>
<td>
<p>
Outputs what matched the last sub-expression to be actually matched.
</p>
</td>
</tr>
<tr>
<td>
<p>
$^N
</p>
</td>
<td>
<p>
As $LAST_SUBMATCH_RESULT
</p>
</td>
</tr>
<tr>
<td>
<p>
$$
</p>
</td>
<td>
<p>
Outputs a literal '$'
</p>
</td>
</tr>
<tr>
<td>
<p>
$n
</p>
</td>
<td>
<p>
Outputs what matched the n'th sub-expression.
</p>
</td>
</tr>
<tr>
<td>
<p>
${n}
</p>
</td>
<td>
<p>
Outputs what matched the n'th sub-expression.
</p>
</td>
</tr>
<tr>
<td>
<p>
$+{NAME}
</p>
</td>
<td>
<p>
Outputs whatever matched the sub-expression named "NAME".
</p>
</td>
</tr>
</tbody>
</table></div>
<p>
Any $-placeholder sequence not listed above, results in '$' being treated
as a literal.
</p>
<p>
An escape character followed by any character x, outputs that character unless
x is one of the escape sequences shown below.
</p>
<div class="informaltable"><table class="table">
<colgroup>
<col>
<col>
</colgroup>
<thead><tr>
<th>
<p>
Escape
</p>
</th>
<th>
<p>
Meaning
</p>
</th>
</tr></thead>
<tbody>
<tr>
<td>
<p>
\a
</p>
</td>
<td>
<p>
Outputs the bell character: '\a'.
</p>
</td>
</tr>
<tr>
<td>
<p>
\e
</p>
</td>
<td>
<p>
Outputs the ANSI escape character (code point 27).
</p>
</td>
</tr>
<tr>
<td>
<p>
\f
</p>
</td>
<td>
<p>
Outputs a form feed character: '\f'
</p>
</td>
</tr>
<tr>
<td>
<p>
\n
</p>
</td>
<td>
<p>
Outputs a newline character: '\n'.
</p>
</td>
</tr>
<tr>
<td>
<p>
\r
</p>
</td>
<td>
<p>
Outputs a carriage return character: '\r'.
</p>
</td>
</tr>
<tr>
<td>
<p>
\t
</p>
</td>
<td>
<p>
Outputs a tab character: '\t'.
</p>
</td>
</tr>
<tr>
<td>
<p>
\v
</p>
</td>
<td>
<p>
Outputs a vertical tab character: '\v'.
</p>
</td>
</tr>
<tr>
<td>
<p>
\xDD
</p>
</td>
<td>
<p>
Outputs the character whose hexadecimal code point is 0xDD
</p>
</td>
</tr>
<tr>
<td>
<p>
\x{DDDD}
</p>
</td>
<td>
<p>
Outputs the character whose hexadecimal code point is 0xDDDDD
</p>
</td>
</tr>
<tr>
<td>
<p>
\cX
</p>
</td>
<td>
<p>
Outputs the ANSI escape sequence "escape-X".
</p>
</td>
</tr>
<tr>
<td>
<p>
\D
</p>
</td>
<td>
<p>
If D is a decimal digit in the range 1-9, then outputs the text
that matched sub-expression D.
</p>
</td>
</tr>
<tr>
<td>
<p>
\l
</p>
</td>
<td>
<p>
Causes the next character to be outputted, to be output in lower
case.
</p>
</td>
</tr>
<tr>
<td>
<p>
\u
</p>
</td>
<td>
<p>
Causes the next character to be outputted, to be output in upper
case.
</p>
</td>
</tr>
<tr>
<td>
<p>
\L
</p>
</td>
<td>
<p>
Causes all subsequent characters to be output in lower case, until
a \E is found.
</p>
</td>
</tr>
<tr>
<td>
<p>
\U
</p>
</td>
<td>
<p>
Causes all subsequent characters to be output in upper case, until
a \E is found.
</p>
</td>
</tr>
<tr>
<td>
<p>
\E
</p>
</td>
<td>
<p>
Terminates a \L or \U sequence.
</p>
</td>
</tr>
</tbody>
</table></div>
</div>
<table xmlns:rev="http://www.cs.rpi.edu/~gregod/boost/tools/doc/revision" width="100%"><tr>
<td align="left"></td>
<td align="right"><div class="copyright-footer">Copyright © 1998-2013 John Maddock<p>
Distributed under the Boost Software License, Version 1.0. (See accompanying
file LICENSE_1_0.txt or copy at <a href="http://www.boost.org/LICENSE_1_0.txt" target="_top">http://www.boost.org/LICENSE_1_0.txt</a>)
</p>
</div></td>
</tr></table>
<hr>
<div class="spirit-nav">
<a accesskey="p" href="sed_format.html"><img src="../../../../../../doc/src/images/prev.png" alt="Prev"></a><a accesskey="u" href="../format.html"><img src="../../../../../../doc/src/images/up.png" alt="Up"></a><a accesskey="h" href="../../index.html"><img src="../../../../../../doc/src/images/home.png" alt="Home"></a><a accesskey="n" href="boost_format_syntax.html"><img src="../../../../../../doc/src/images/next.png" alt="Next"></a>
</div>
</body>
</html>

View File

@ -0,0 +1,249 @@
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title>Sed Format String Syntax</title>
<link rel="stylesheet" href="../../../../../../doc/src/boostbook.css" type="text/css">
<meta name="generator" content="DocBook XSL Stylesheets V1.79.1">
<link rel="home" href="../../index.html" title="Boost.Regex 7.0.1">
<link rel="up" href="../format.html" title="Search and Replace Format String Syntax">
<link rel="prev" href="../format.html" title="Search and Replace Format String Syntax">
<link rel="next" href="perl_format.html" title="Perl Format String Syntax">
</head>
<body bgcolor="white" text="black" link="#0000FF" vlink="#840084" alink="#0000FF">
<table cellpadding="2" width="100%"><tr>
<td valign="top"><img alt="Boost C++ Libraries" width="277" height="86" src="../../../../../../boost.png"></td>
<td align="center"><a href="../../../../../../index.html">Home</a></td>
<td align="center"><a href="../../../../../../libs/libraries.htm">Libraries</a></td>
<td align="center"><a href="http://www.boost.org/users/people.html">People</a></td>
<td align="center"><a href="http://www.boost.org/users/faq.html">FAQ</a></td>
<td align="center"><a href="../../../../../../more/index.htm">More</a></td>
</tr></table>
<hr>
<div class="spirit-nav">
<a accesskey="p" href="../format.html"><img src="../../../../../../doc/src/images/prev.png" alt="Prev"></a><a accesskey="u" href="../format.html"><img src="../../../../../../doc/src/images/up.png" alt="Up"></a><a accesskey="h" href="../../index.html"><img src="../../../../../../doc/src/images/home.png" alt="Home"></a><a accesskey="n" href="perl_format.html"><img src="../../../../../../doc/src/images/next.png" alt="Next"></a>
</div>
<div class="section">
<div class="titlepage"><div><div><h3 class="title">
<a name="boost_regex.format.sed_format"></a><a class="link" href="sed_format.html" title="Sed Format String Syntax">Sed Format String Syntax</a>
</h3></div></div></div>
<p>
Sed-style format strings treat all characters as literals except:
</p>
<div class="informaltable"><table class="table">
<colgroup>
<col>
<col>
</colgroup>
<thead><tr>
<th>
<p>
character
</p>
</th>
<th>
<p>
description
</p>
</th>
</tr></thead>
<tbody>
<tr>
<td>
<p>
&amp;
</p>
</td>
<td>
<p>
The ampersand character is replaced in the output stream by the
whole of what matched the regular expression. Use \&amp; to output
a literal '&amp;' character.
</p>
</td>
</tr>
<tr>
<td>
<p>
\
</p>
</td>
<td>
<p>
Specifies an escape sequence.
</p>
</td>
</tr>
</tbody>
</table></div>
<p>
An escape character followed by any character x, outputs that character unless
x is one of the escape sequences shown below.
</p>
<div class="informaltable"><table class="table">
<colgroup>
<col>
<col>
</colgroup>
<thead><tr>
<th>
<p>
Escape
</p>
</th>
<th>
<p>
Meaning
</p>
</th>
</tr></thead>
<tbody>
<tr>
<td>
<p>
\a
</p>
</td>
<td>
<p>
Outputs the bell character: '\a'.
</p>
</td>
</tr>
<tr>
<td>
<p>
\e
</p>
</td>
<td>
<p>
Outputs the ANSI escape character (code point 27).
</p>
</td>
</tr>
<tr>
<td>
<p>
\f
</p>
</td>
<td>
<p>
Outputs a form feed character: '\f'
</p>
</td>
</tr>
<tr>
<td>
<p>
\n
</p>
</td>
<td>
<p>
Outputs a newline character: '\n'.
</p>
</td>
</tr>
<tr>
<td>
<p>
\r
</p>
</td>
<td>
<p>
Outputs a carriage return character: '\r'.
</p>
</td>
</tr>
<tr>
<td>
<p>
\t
</p>
</td>
<td>
<p>
Outputs a tab character: '\t'.
</p>
</td>
</tr>
<tr>
<td>
<p>
\v
</p>
</td>
<td>
<p>
Outputs a vertical tab character: '\v'.
</p>
</td>
</tr>
<tr>
<td>
<p>
\xDD
</p>
</td>
<td>
<p>
Outputs the character whose hexadecimal code point is 0xDD
</p>
</td>
</tr>
<tr>
<td>
<p>
\x{DDDD}
</p>
</td>
<td>
<p>
Outputs the character whose hexadecimal code point is 0xDDDDD
</p>
</td>
</tr>
<tr>
<td>
<p>
\cX
</p>
</td>
<td>
<p>
Outputs the ANSI escape sequence "escape-X".
</p>
</td>
</tr>
<tr>
<td>
<p>
\D
</p>
</td>
<td>
<p>
If D is a decimal digit in the range 1-9, then outputs the text
that matched sub-expression D.
</p>
</td>
</tr>
</tbody>
</table></div>
</div>
<table xmlns:rev="http://www.cs.rpi.edu/~gregod/boost/tools/doc/revision" width="100%"><tr>
<td align="left"></td>
<td align="right"><div class="copyright-footer">Copyright © 1998-2013 John Maddock<p>
Distributed under the Boost Software License, Version 1.0. (See accompanying
file LICENSE_1_0.txt or copy at <a href="http://www.boost.org/LICENSE_1_0.txt" target="_top">http://www.boost.org/LICENSE_1_0.txt</a>)
</p>
</div></td>
</tr></table>
<hr>
<div class="spirit-nav">
<a accesskey="p" href="../format.html"><img src="../../../../../../doc/src/images/prev.png" alt="Prev"></a><a accesskey="u" href="../format.html"><img src="../../../../../../doc/src/images/up.png" alt="Up"></a><a accesskey="h" href="../../index.html"><img src="../../../../../../doc/src/images/home.png" alt="Home"></a><a accesskey="n" href="perl_format.html"><img src="../../../../../../doc/src/images/next.png" alt="Next"></a>
</div>
</body>
</html>

View File

@ -0,0 +1,370 @@
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title>Building and Installing the Library</title>
<link rel="stylesheet" href="../../../../../doc/src/boostbook.css" type="text/css">
<meta name="generator" content="DocBook XSL Stylesheets V1.79.1">
<link rel="home" href="../index.html" title="Boost.Regex 7.0.1">
<link rel="up" href="../index.html" title="Boost.Regex 7.0.1">
<link rel="prev" href="configuration/tuning.html" title="Algorithm Tuning">
<link rel="next" href="intro.html" title="Introduction and Overview">
</head>
<body bgcolor="white" text="black" link="#0000FF" vlink="#840084" alink="#0000FF">
<table cellpadding="2" width="100%"><tr>
<td valign="top"><img alt="Boost C++ Libraries" width="277" height="86" src="../../../../../boost.png"></td>
<td align="center"><a href="../../../../../index.html">Home</a></td>
<td align="center"><a href="../../../../../libs/libraries.htm">Libraries</a></td>
<td align="center"><a href="http://www.boost.org/users/people.html">People</a></td>
<td align="center"><a href="http://www.boost.org/users/faq.html">FAQ</a></td>
<td align="center"><a href="../../../../../more/index.htm">More</a></td>
</tr></table>
<hr>
<div class="spirit-nav">
<a accesskey="p" href="configuration/tuning.html"><img src="../../../../../doc/src/images/prev.png" alt="Prev"></a><a accesskey="u" href="../index.html"><img src="../../../../../doc/src/images/up.png" alt="Up"></a><a accesskey="h" href="../index.html"><img src="../../../../../doc/src/images/home.png" alt="Home"></a><a accesskey="n" href="intro.html"><img src="../../../../../doc/src/images/next.png" alt="Next"></a>
</div>
<div class="section">
<div class="titlepage"><div><div><h2 class="title" style="clear: both">
<a name="boost_regex.install"></a><a class="link" href="install.html" title="Building and Installing the Library">Building and Installing the Library</a>
</h2></div></div></div>
<p>
When you extract the library from its zip file, you must preserve its internal
directory structure (for example by using the -d option when extracting). If
you didn't do that when extracting, then you'd better stop reading this, delete
the files you just extracted, and try again!
</p>
<p>
This library should not need configuring before use; most popular compilers/standard
libraries/platforms are already supported "as is". If you do experience
configuration problems, or just want to test the configuration with your compiler,
then the process is the same as for all of boost; see the <a href="../../../../config/index.html" target="_top">configuration
library documentation</a>.
</p>
<p>
The library will encase all code inside namespace boost.
</p>
<p>
This is a header only library provided your compiler supports C++11 or later.
Support for C++03 compilers is still present, but is now deprecated and may
be removed without further notice!
</p>
<p>
The only people that still need to build the external libboost_regex library
are those that are either:
</p>
<div class="itemizedlist"><ul class="itemizedlist" style="list-style-type: disc; ">
<li class="listitem">
Using the library in C++03 mode, or,
</li>
<li class="listitem">
Using the deprecated POSIX C API's
</li>
</ul></div>
<p>
Further, this library may now be used in "standalone" mode without
the rest of the Boost C++ libraries, in order to do this you must either:
</p>
<div class="itemizedlist"><ul class="itemizedlist" style="list-style-type: disc; ">
<li class="listitem">
Have a C++17 compiler that supports <code class="computeroutput"><span class="identifier">__has_include</span></code>,
in this case if <code class="computeroutput"><span class="special">&lt;</span><span class="identifier">boost</span><span class="special">/</span><span class="identifier">config</span><span class="special">.</span><span class="identifier">hpp</span><span class="special">&gt;</span></code> is not present then the library will
automoatically enter standalone mode. Or:
</li>
<li class="listitem">
Define BOOST_REGEX_STANDALONE when building.
</li>
</ul></div>
<p>
If you are using this library with ICU, note that since it is now header only,
it will be up to you to link to the ICU libraries if you use <code class="computeroutput"><span class="special">&lt;</span><span class="identifier">boost</span><span class="special">/</span><span class="identifier">regex</span><span class="special">/</span><span class="identifier">icu</span><span class="special">.</span><span class="identifier">hpp</span><span class="special">&gt;</span></code> unless you are using the supplied CMake
script.
</p>
<h5>
<a name="boost_regex.install.h0"></a>
<span class="phrase"><a name="boost_regex.install.usage_with_cmake"></a></span><a class="link" href="install.html#boost_regex.install.usage_with_cmake">Usage
with CMake</a>
</h5>
<p>
The library comes with a very basic CMakeLists.txt that allows this library
to be used from other CMake scripts.
</p>
<p>
CMakeLists.txt defines two targets:
</p>
<div class="itemizedlist"><ul class="itemizedlist" style="list-style-type: disc; ">
<li class="listitem">
<code class="computeroutput"><span class="identifier">Boost</span><span class="special">::</span><span class="identifier">regex</span></code> This is the target to use for normal
header only builds.
</li>
<li class="listitem">
<code class="computeroutput"><span class="identifier">Boost</span><span class="special">::</span><span class="identifier">regex_icu</span></code> This is the target to use if
you are using <code class="computeroutput"><span class="special">&lt;</span><span class="identifier">boost</span><span class="special">/</span><span class="identifier">regex</span><span class="special">/</span><span class="identifier">icu</span><span class="special">.</span><span class="identifier">hpp</span><span class="special">&gt;</span></code> in your code, and wish to have the
ICU dependencies taken care of for you.
</li>
</ul></div>
<p>
There is also one configuration option:
</p>
<div class="itemizedlist"><ul class="itemizedlist" style="list-style-type: disc; "><li class="listitem">
BOOST_REGEX_STANDALONE when set then no other Boost libraries are targeted
as dependencies, and Boost.Regex is placed in standalone mode. Invoke CMake
with -DBOOST_REGEX_STANDALONE=on to enable standalone mode.
</li></ul></div>
<h5>
<a name="boost_regex.install.h1"></a>
<span class="phrase"><a name="boost_regex.install.c_03_users_only_deprecated_build"></a></span><a class="link" href="install.html#boost_regex.install.c_03_users_only_deprecated_build"><span class="bold"><strong>C++03 users only (DEPRECATED)</strong></span> Building with bjam</a>
</h5>
<p>
This is now the preferred method for building and installing legacy versions
this library, please refer to the <a href="../../../../../more/getting_started.html" target="_top">getting
started guide</a> for more information.
</p>
<h5>
<a name="boost_regex.install.h2"></a>
<span class="phrase"><a name="boost_regex.install.building_with_unicode_and_icu_su"></a></span><a class="link" href="install.html#boost_regex.install.building_with_unicode_and_icu_su">Building
With Unicode and ICU Support</a>
</h5>
<p>
Boost.Regex is now capable of performing a configuration check to test whether
ICU is already installed in your compiler's search paths. When you build you
should see a message like this:
</p>
<pre class="programlisting"><span class="identifier">Performing</span> <span class="identifier">configuration</span> <span class="identifier">checks</span>
<span class="special">-</span> <span class="identifier">has_icu</span> <span class="identifier">builds</span> <span class="special">:</span> <span class="identifier">yes</span>
</pre>
<p>
Which means that ICU has been found, and support for it will be enabled in
the library build.
</p>
<div class="tip"><table border="0" summary="Tip">
<tr>
<td rowspan="2" align="center" valign="top" width="25"><img alt="[Tip]" src="../../../../../doc/src/images/tip.png"></td>
<th align="left">Tip</th>
</tr>
<tr><td align="left" valign="top"><p>
If you don't want the regex library to use ICU then build with the "--disable-icu"
command line option.
</p></td></tr>
</table></div>
<p>
If instead you see:
</p>
<pre class="programlisting"><span class="identifier">Performing</span> <span class="identifier">configuration</span> <span class="identifier">checks</span>
<span class="special">-</span> <span class="identifier">has_icu</span> <span class="identifier">builds</span> <span class="special">:</span> <span class="identifier">no</span>
</pre>
<p>
Then ICU was not found and support for it will not be compiled into the library.
If you think that it should have been found, then you will need to take a look
at the contents of the file <span class="emphasis"><em>boost-root/bin.v2/config.log</em></span>
for the actual error messages obtained when the build carried out the configuration
check. You will then need to fix these errors by ensuring your compiler gets
invoked with the correct options. The main options that you're likely to pass
to <code class="computeroutput"><span class="identifier">b2</span></code> are:
</p>
<div class="informaltable"><table class="table">
<colgroup>
<col>
<col>
</colgroup>
<thead><tr>
<th>
<p>
Option
</p>
</th>
<th>
<p>
Description
</p>
</th>
</tr></thead>
<tbody>
<tr>
<td>
<p>
include=/some/path
</p>
</td>
<td>
<p>
Adds "/some/path" to the list of paths seached for include
files, normally equivalent to <code class="computeroutput"><span class="special">-</span><span class="identifier">I</span><span class="special">/</span><span class="identifier">some</span><span class="special">/</span><span class="identifier">path</span></code> on most compilers.
</p>
</td>
</tr>
<tr>
<td>
<p>
library-path=/some/path
</p>
</td>
<td>
<p>
Adds "/some/path" to the list of paths searched for external
libraries, set this to the location of the ICU binaries if they're
in a non-standard location.
</p>
</td>
</tr>
<tr>
<td>
<p>
-sICU_ICUUC_NAME=NAME
</p>
</td>
<td>
<p>
If <code class="computeroutput"><span class="identifier">libicuuc</span></code> has a
non-standard name then this sets the name of the library linked against,
defaults to either <code class="computeroutput"><span class="identifier">icuuc</span></code>,
<code class="computeroutput"><span class="identifier">icuucd</span></code>, <code class="computeroutput"><span class="identifier">sicuuc</span></code> or <code class="computeroutput"><span class="identifier">sicuucd</span></code>
depending on build options.
</p>
</td>
</tr>
<tr>
<td>
<p>
-sICU_ICUDT_NAME=NAME
</p>
</td>
<td>
<p>
If <code class="computeroutput"><span class="identifier">libicudata</span></code> has
a non-standard name then this sets the name of the library linked
against, defaults to either <code class="computeroutput"><span class="identifier">icudt</span></code>,
<code class="computeroutput"><span class="identifier">icudata</span></code>, <code class="computeroutput"><span class="identifier">sicudt</span></code> or <code class="computeroutput"><span class="identifier">sicudata</span></code>
depending on build options and platform.
</p>
</td>
</tr>
<tr>
<td>
<p>
-sICU_ICUIN_NAME=NAME
</p>
</td>
<td>
<p>
If <code class="computeroutput"><span class="identifier">libicui18n</span></code> has
a non-standatd name then this sets the name of the library linked
against, defaults to either <code class="computeroutput"><span class="identifier">icui18n</span></code>,
<code class="computeroutput"><span class="identifier">icuin</span></code>, <code class="computeroutput"><span class="identifier">icuind</span></code>, sicuin<code class="computeroutput"> <span class="keyword">or</span>
</code>sicuins` depending on build options and platform.
</p>
</td>
</tr>
<tr>
<td>
<p>
cxxstd=XX
</p>
</td>
<td>
<p>
Sets the C++ standard supported: XX should be either 03, 11, 14,
17 or 2a.
</p>
</td>
</tr>
<tr>
<td>
<p>
cxxflags="FLAGS"
</p>
</td>
<td>
<p>
Passes "FLAGS" directly to the compiler, an option of last
resort!
</p>
</td>
</tr>
<tr>
<td>
<p>
linflags="FLAGS"
</p>
</td>
<td>
<p>
Passes "FLAGS" directly to the compiler on the link step,
an option of last resort!
</p>
</td>
</tr>
</tbody>
</table></div>
<div class="important"><table border="0" summary="Important">
<tr>
<td rowspan="2" align="center" valign="top" width="25"><img alt="[Important]" src="../../../../../doc/src/images/important.png"></td>
<th align="left">Important</th>
</tr>
<tr><td align="left" valign="top"><p>
Configuration results are cached - if you try rebuilding with different compiler
options then add an "-a" to the bjam command line to force all
targets to be rebuilt.
</p></td></tr>
</table></div>
<div class="important"><table border="0" summary="Important">
<tr>
<td rowspan="2" align="center" valign="top" width="25"><img alt="[Important]" src="../../../../../doc/src/images/important.png"></td>
<th align="left">Important</th>
</tr>
<tr><td align="left" valign="top"><p>
ICU is a C++ library just like Boost is, as such your copy of ICU must have
been built with the same C++ compiler (and compiler version) that you are
using to build Boost. Boost.Regex will not work correctly unless you ensure
that this is the case: it is up to you to ensure that the version of ICU
you are using is binary compatible with the toolset you use to build Boost.
</p></td></tr>
</table></div>
<p>
And finally, if you want to build/test with multiple compiler versions, all
with different ICU builds, then the only way to achieve that currently is to
modify your user-config.jam so that each toolset has the necessary compiler/linker
options set so that ICU is found automatically by the configuration step (providing
the ICU binaries use the standard names, all you have to add is the appropriate
header-include and linker-search paths).
</p>
<h5>
<a name="boost_regex.install.h3"></a>
<span class="phrase"><a name="boost_regex.install.building_from_source"></a></span><a class="link" href="install.html#boost_regex.install.building_from_source">Building
from Source</a>
</h5>
<p>
The Regex library is "just a bunch of source files": nothing special
is required to build them.
</p>
<p>
You can either build the files under boost-path/libs/regex/src/*.cpp as a library,
or add them directly to your project. This is particularly useful if you need
to use specific compiler options not supported by the default Boost build.
</p>
<p>
There are two #defines you should be aware of:
</p>
<div class="itemizedlist"><ul class="itemizedlist" style="list-style-type: disc; ">
<li class="listitem">
BOOST_HAS_ICU should be defined if you want ICU support compiled in.
</li>
<li class="listitem">
BOOST_REGEX_DYN_LINK should be defined if you are building a DLL on Windows.
</li>
</ul></div>
</div>
<table xmlns:rev="http://www.cs.rpi.edu/~gregod/boost/tools/doc/revision" width="100%"><tr>
<td align="left"></td>
<td align="right"><div class="copyright-footer">Copyright © 1998-2013 John Maddock<p>
Distributed under the Boost Software License, Version 1.0. (See accompanying
file LICENSE_1_0.txt or copy at <a href="http://www.boost.org/LICENSE_1_0.txt" target="_top">http://www.boost.org/LICENSE_1_0.txt</a>)
</p>
</div></td>
</tr></table>
<hr>
<div class="spirit-nav">
<a accesskey="p" href="configuration/tuning.html"><img src="../../../../../doc/src/images/prev.png" alt="Prev"></a><a accesskey="u" href="../index.html"><img src="../../../../../doc/src/images/up.png" alt="Up"></a><a accesskey="h" href="../index.html"><img src="../../../../../doc/src/images/home.png" alt="Home"></a><a accesskey="n" href="intro.html"><img src="../../../../../doc/src/images/next.png" alt="Next"></a>
</div>
</body>
</html>

View File

@ -0,0 +1,214 @@
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title>Introduction and Overview</title>
<link rel="stylesheet" href="../../../../../doc/src/boostbook.css" type="text/css">
<meta name="generator" content="DocBook XSL Stylesheets V1.79.1">
<link rel="home" href="../index.html" title="Boost.Regex 7.0.1">
<link rel="up" href="../index.html" title="Boost.Regex 7.0.1">
<link rel="prev" href="install.html" title="Building and Installing the Library">
<link rel="next" href="unicode.html" title="Unicode and Boost.Regex">
</head>
<body bgcolor="white" text="black" link="#0000FF" vlink="#840084" alink="#0000FF">
<table cellpadding="2" width="100%"><tr>
<td valign="top"><img alt="Boost C++ Libraries" width="277" height="86" src="../../../../../boost.png"></td>
<td align="center"><a href="../../../../../index.html">Home</a></td>
<td align="center"><a href="../../../../../libs/libraries.htm">Libraries</a></td>
<td align="center"><a href="http://www.boost.org/users/people.html">People</a></td>
<td align="center"><a href="http://www.boost.org/users/faq.html">FAQ</a></td>
<td align="center"><a href="../../../../../more/index.htm">More</a></td>
</tr></table>
<hr>
<div class="spirit-nav">
<a accesskey="p" href="install.html"><img src="../../../../../doc/src/images/prev.png" alt="Prev"></a><a accesskey="u" href="../index.html"><img src="../../../../../doc/src/images/up.png" alt="Up"></a><a accesskey="h" href="../index.html"><img src="../../../../../doc/src/images/home.png" alt="Home"></a><a accesskey="n" href="unicode.html"><img src="../../../../../doc/src/images/next.png" alt="Next"></a>
</div>
<div class="section">
<div class="titlepage"><div><div><h2 class="title" style="clear: both">
<a name="boost_regex.intro"></a><a class="link" href="intro.html" title="Introduction and Overview">Introduction and Overview</a>
</h2></div></div></div>
<p>
Regular expressions are a form of pattern-matching that are often used in text
processing; many users will be familiar with the Unix utilities grep, sed and
awk, and the programming language Perl, each of which make extensive use of
regular expressions. Traditionally C++ users have been limited to the POSIX
C API's for manipulating regular expressions, and while Boost.Regex does provide
these API's, they do not represent the best way to use the library. For example
Boost.Regex can cope with wide character strings, or search and replace operations
(in a manner analogous to either sed or Perl), something that traditional C
libraries can not do.
</p>
<p>
The class <a class="link" href="ref/basic_regex.html" title="basic_regex"><code class="computeroutput"><span class="identifier">basic_regex</span></code></a>
is the key class in this library; it represents a "machine readable"
regular expression, and is very closely modeled on <code class="computeroutput"><span class="identifier">std</span><span class="special">::</span><span class="identifier">basic_string</span></code>,
think of it as a string plus the actual state-machine required by the regular
expression algorithms. Like <code class="computeroutput"><span class="identifier">std</span><span class="special">::</span><span class="identifier">basic_string</span></code>
there are two typedefs that are almost always the means by which this class
is referenced:
</p>
<pre class="programlisting"><span class="keyword">namespace</span> <span class="identifier">boost</span><span class="special">{</span>
<span class="keyword">template</span> <span class="special">&lt;</span><span class="keyword">class</span> <span class="identifier">charT</span><span class="special">,</span>
<span class="keyword">class</span> <span class="identifier">traits</span> <span class="special">=</span> <span class="identifier">regex_traits</span><span class="special">&lt;</span><span class="identifier">charT</span><span class="special">&gt;</span> <span class="special">&gt;</span>
<span class="keyword">class</span> <span class="identifier">basic_regex</span><span class="special">;</span>
<span class="keyword">typedef</span> <span class="identifier">basic_regex</span><span class="special">&lt;</span><span class="keyword">char</span><span class="special">&gt;</span> <span class="identifier">regex</span><span class="special">;</span>
<span class="keyword">typedef</span> <span class="identifier">basic_regex</span><span class="special">&lt;</span><span class="keyword">wchar_t</span><span class="special">&gt;</span> <span class="identifier">wregex</span><span class="special">;</span>
<span class="special">}</span>
</pre>
<p>
To see how this library can be used, imagine that we are writing a credit card
processing application. Credit card numbers generally come as a string of 16-digits,
separated into groups of 4-digits, and separated by either a space or a hyphen.
Before storing a credit card number in a database (not necessarily something
your customers will appreciate!), we may want to verify that the number is
in the correct format. To match any digit we could use the regular expression
[0-9], however ranges of characters like this are actually locale dependent.
Instead we should use the POSIX standard form [[:digit:]], or the Boost.Regex
and Perl shorthand for this \d (note that many older libraries tended to be
hard-coded to the C-locale, consequently this was not an issue for them). That
leaves us with the following regular expression to validate credit card number
formats:
</p>
<pre class="programlisting">(\d{4}[- ]){3}\d{4}</pre>
<p>
Here the parenthesis act to group (and mark for future reference) sub-expressions,
and the {4} means "repeat exactly 4 times". This is an example of
the extended regular expression syntax used by Perl, awk and egrep. Boost.Regex
also supports the older "basic" syntax used by sed and grep, but
this is generally less useful, unless you already have some basic regular expressions
that you need to reuse.
</p>
<p>
Now let's take that expression and place it in some C++ code to validate the
format of a credit card number:
</p>
<pre class="programlisting"><span class="keyword">bool</span> <span class="identifier">validate_card_format</span><span class="special">(</span><span class="keyword">const</span> <span class="identifier">std</span><span class="special">::</span><span class="identifier">string</span><span class="special">&amp;</span> <span class="identifier">s</span><span class="special">)</span>
<span class="special">{</span>
<span class="keyword">static</span> <span class="keyword">const</span> <span class="identifier">boost</span><span class="special">::</span><span class="identifier">regex</span> <span class="identifier">e</span><span class="special">(</span><span class="string">"(\\d{4}[- ]){3}\\d{4}"</span><span class="special">);</span>
<span class="keyword">return</span> <span class="identifier">regex_match</span><span class="special">(</span><span class="identifier">s</span><span class="special">,</span> <span class="identifier">e</span><span class="special">);</span>
<span class="special">}</span>
</pre>
<p>
Note how we had to add some extra escapes to the expression: remember that
the escape is seen once by the C++ compiler, before it gets to be seen by the
regular expression engine, consequently escapes in regular expressions have
to be doubled up when embedding them in C/C++ code. Also note that all the
examples assume that your compiler supports argument-dependent lookup, if yours
doesn't (for example VC6), then you will have to add some <code class="computeroutput"><span class="identifier">boost</span><span class="special">::</span></code> prefixes to some of the function calls in
the examples.
</p>
<p>
Those of you who are familiar with credit card processing, will have realized
that while the format used above is suitable for human readable card numbers,
it does not represent the format required by online credit card systems; these
require the number as a string of 16 (or possibly 15) digits, without any intervening
spaces. What we need is a means to convert easily between the two formats,
and this is where search and replace comes in. Those who are familiar with
the utilities sed and Perl will already be ahead here; we need two strings
- one a regular expression - the other a "format string" that provides
a description of the text to replace the match with. In Boost.Regex this search
and replace operation is performed with the algorithm <a class="link" href="ref/regex_replace.html" title="regex_replace"><code class="computeroutput"><span class="identifier">regex_replace</span></code></a>, for our credit card
example we can write two algorithms like this to provide the format conversions:
</p>
<pre class="programlisting"><span class="comment">// match any format with the regular expression:</span>
<span class="keyword">const</span> <span class="identifier">boost</span><span class="special">::</span><span class="identifier">regex</span> <span class="identifier">e</span><span class="special">(</span><span class="string">"\\A(\\d{3,4})[- ]?(\\d{4})[- ]?(\\d{4})[- ]?(\\d{4})\\z"</span><span class="special">);</span>
<span class="keyword">const</span> <span class="identifier">std</span><span class="special">::</span><span class="identifier">string</span> <span class="identifier">machine_format</span><span class="special">(</span><span class="string">"\\1\\2\\3\\4"</span><span class="special">);</span>
<span class="keyword">const</span> <span class="identifier">std</span><span class="special">::</span><span class="identifier">string</span> <span class="identifier">human_format</span><span class="special">(</span><span class="string">"\\1-\\2-\\3-\\4"</span><span class="special">);</span>
<span class="identifier">std</span><span class="special">::</span><span class="identifier">string</span> <span class="identifier">machine_readable_card_number</span><span class="special">(</span><span class="keyword">const</span> <span class="identifier">std</span><span class="special">::</span><span class="identifier">string</span> <span class="identifier">s</span><span class="special">)</span>
<span class="special">{</span>
<span class="keyword">return</span> <span class="identifier">regex_replace</span><span class="special">(</span><span class="identifier">s</span><span class="special">,</span> <span class="identifier">e</span><span class="special">,</span> <span class="identifier">machine_format</span><span class="special">,</span> <span class="identifier">boost</span><span class="special">::</span><span class="identifier">match_default</span> <span class="special">|</span> <span class="identifier">boost</span><span class="special">::</span><span class="identifier">format_sed</span><span class="special">);</span>
<span class="special">}</span>
<span class="identifier">std</span><span class="special">::</span><span class="identifier">string</span> <span class="identifier">human_readable_card_number</span><span class="special">(</span><span class="keyword">const</span> <span class="identifier">std</span><span class="special">::</span><span class="identifier">string</span> <span class="identifier">s</span><span class="special">)</span>
<span class="special">{</span>
<span class="keyword">return</span> <span class="identifier">regex_replace</span><span class="special">(</span><span class="identifier">s</span><span class="special">,</span> <span class="identifier">e</span><span class="special">,</span> <span class="identifier">human_format</span><span class="special">,</span> <span class="identifier">boost</span><span class="special">::</span><span class="identifier">match_default</span> <span class="special">|</span> <span class="identifier">boost</span><span class="special">::</span><span class="identifier">format_sed</span><span class="special">);</span>
<span class="special">}</span>
</pre>
<p>
Here we've used marked sub-expressions in the regular expression to split out
the four parts of the card number as separate fields, the format string then
uses the sed-like syntax to replace the matched text with the reformatted version.
</p>
<p>
In the examples above, we haven't directly manipulated the results of a regular
expression match, however in general the result of a match contains a number
of sub-expression matches in addition to the overall match. When the library
needs to report a regular expression match it does so using an instance of
the class <a class="link" href="ref/match_results.html" title="match_results"><code class="computeroutput"><span class="identifier">match_results</span></code></a>,
as before there are typedefs of this class for the most common cases:
</p>
<pre class="programlisting"><span class="keyword">namespace</span> <span class="identifier">boost</span><span class="special">{</span>
<span class="keyword">typedef</span> <span class="identifier">match_results</span><span class="special">&lt;</span><span class="keyword">const</span> <span class="keyword">char</span><span class="special">*&gt;</span> <span class="identifier">cmatch</span><span class="special">;</span>
<span class="keyword">typedef</span> <span class="identifier">match_results</span><span class="special">&lt;</span><span class="keyword">const</span> <span class="keyword">wchar_t</span><span class="special">*&gt;</span> <span class="identifier">wcmatch</span><span class="special">;</span>
<span class="keyword">typedef</span> <span class="identifier">match_results</span><span class="special">&lt;</span><span class="identifier">std</span><span class="special">::</span><span class="identifier">string</span><span class="special">::</span><span class="identifier">const_iterator</span><span class="special">&gt;</span> <span class="identifier">smatch</span><span class="special">;</span>
<span class="keyword">typedef</span> <span class="identifier">match_results</span><span class="special">&lt;</span><span class="identifier">std</span><span class="special">::</span><span class="identifier">wstring</span><span class="special">::</span><span class="identifier">const_iterator</span><span class="special">&gt;</span> <span class="identifier">wsmatch</span><span class="special">;</span>
<span class="special">}</span>
</pre>
<p>
The algorithms <a class="link" href="ref/regex_search.html" title="regex_search"><code class="computeroutput"><span class="identifier">regex_search</span></code></a>
and <a class="link" href="ref/regex_match.html" title="regex_match"><code class="computeroutput"><span class="identifier">regex_match</span></code></a>
make use of <a class="link" href="ref/match_results.html" title="match_results"><code class="computeroutput"><span class="identifier">match_results</span></code></a>
to report what matched; the difference between these algorithms is that <a class="link" href="ref/regex_match.html" title="regex_match"><code class="computeroutput"><span class="identifier">regex_match</span></code></a>
will only find matches that consume <span class="emphasis"><em>all</em></span> of the input text,
where as <a class="link" href="ref/regex_search.html" title="regex_search"><code class="computeroutput"><span class="identifier">regex_search</span></code></a>
will search for a match anywhere within the text being matched.
</p>
<p>
Note that these algorithms are not restricted to searching regular C-strings,
any bidirectional iterator type can be searched, allowing for the possibility
of seamlessly searching almost any kind of data.
</p>
<p>
For search and replace operations, in addition to the algorithm <a class="link" href="ref/regex_replace.html" title="regex_replace"><code class="computeroutput"><span class="identifier">regex_replace</span></code></a> that we have already
seen, the <a class="link" href="ref/match_results.html" title="match_results"><code class="computeroutput"><span class="identifier">match_results</span></code></a>
class has a <code class="computeroutput"><span class="identifier">format</span></code> member that
takes the result of a match and a format string, and produces a new string
by merging the two.
</p>
<p>
For iterating through all occurrences of an expression within a text, there
are two iterator types: <a class="link" href="ref/regex_iterator.html" title="regex_iterator"><code class="computeroutput"><span class="identifier">regex_iterator</span></code></a> will enumerate over
the <a class="link" href="ref/match_results.html" title="match_results"><code class="computeroutput"><span class="identifier">match_results</span></code></a>
objects found, while <a class="link" href="ref/regex_token_iterator.html" title="regex_token_iterator"><code class="computeroutput"><span class="identifier">regex_token_iterator</span></code></a> will enumerate
a series of strings (similar to perl style split operations).
</p>
<p>
For those that dislike templates, there is a high level wrapper class <a class="link" href="ref/deprecated/old_regex.html" title="High Level Class RegEx (Deprecated)"><code class="computeroutput"><span class="identifier">RegEx</span></code></a>
that is an encapsulation of the lower level template code - it provides a simplified
interface for those that don't need the full power of the library, and supports
only narrow characters, and the "extended" regular expression syntax.
This class is now deprecated as it does not form part of the regular expressions
C++ standard library proposal.
</p>
<p>
The POSIX API functions: <a class="link" href="ref/posix.html#boost_regex.ref.posix.regcomp"><code class="computeroutput"><span class="identifier">regcomp</span></code></a>, <a class="link" href="ref/posix.html#boost_regex.ref.posix.regexec"><code class="computeroutput"><span class="identifier">regexec</span></code></a>, <a class="link" href="ref/posix.html#boost_regex.ref.posix.regfree"><code class="computeroutput"><span class="identifier">regfree</span></code></a> and [regerr], are available
in both narrow character and Unicode versions, and are provided for those who
need compatibility with these API's.
</p>
<p>
Finally, note that the library now has <a class="link" href="background/locale.html" title="Localization">run-time
localization support</a>, and recognizes the full POSIX regular expression
syntax - including advanced features like multi-character collating elements
and equivalence classes - as well as providing compatibility with other regular
expression libraries including GNU and BSD4 regex packages, PCRE and Perl 5.
</p>
</div>
<table xmlns:rev="http://www.cs.rpi.edu/~gregod/boost/tools/doc/revision" width="100%"><tr>
<td align="left"></td>
<td align="right"><div class="copyright-footer">Copyright © 1998-2013 John Maddock<p>
Distributed under the Boost Software License, Version 1.0. (See accompanying
file LICENSE_1_0.txt or copy at <a href="http://www.boost.org/LICENSE_1_0.txt" target="_top">http://www.boost.org/LICENSE_1_0.txt</a>)
</p>
</div></td>
</tr></table>
<hr>
<div class="spirit-nav">
<a accesskey="p" href="install.html"><img src="../../../../../doc/src/images/prev.png" alt="Prev"></a><a accesskey="u" href="../index.html"><img src="../../../../../doc/src/images/up.png" alt="Up"></a><a accesskey="h" href="../index.html"><img src="../../../../../doc/src/images/home.png" alt="Home"></a><a accesskey="n" href="unicode.html"><img src="../../../../../doc/src/images/next.png" alt="Next"></a>
</div>
</body>
</html>

View File

@ -0,0 +1,316 @@
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title>Partial Matches</title>
<link rel="stylesheet" href="../../../../../doc/src/boostbook.css" type="text/css">
<meta name="generator" content="DocBook XSL Stylesheets V1.79.1">
<link rel="home" href="../index.html" title="Boost.Regex 7.0.1">
<link rel="up" href="../index.html" title="Boost.Regex 7.0.1">
<link rel="prev" href="captures.html" title="Understanding Marked Sub-Expressions and Captures">
<link rel="next" href="syntax.html" title="Regular Expression Syntax">
</head>
<body bgcolor="white" text="black" link="#0000FF" vlink="#840084" alink="#0000FF">
<table cellpadding="2" width="100%"><tr>
<td valign="top"><img alt="Boost C++ Libraries" width="277" height="86" src="../../../../../boost.png"></td>
<td align="center"><a href="../../../../../index.html">Home</a></td>
<td align="center"><a href="../../../../../libs/libraries.htm">Libraries</a></td>
<td align="center"><a href="http://www.boost.org/users/people.html">People</a></td>
<td align="center"><a href="http://www.boost.org/users/faq.html">FAQ</a></td>
<td align="center"><a href="../../../../../more/index.htm">More</a></td>
</tr></table>
<hr>
<div class="spirit-nav">
<a accesskey="p" href="captures.html"><img src="../../../../../doc/src/images/prev.png" alt="Prev"></a><a accesskey="u" href="../index.html"><img src="../../../../../doc/src/images/up.png" alt="Up"></a><a accesskey="h" href="../index.html"><img src="../../../../../doc/src/images/home.png" alt="Home"></a><a accesskey="n" href="syntax.html"><img src="../../../../../doc/src/images/next.png" alt="Next"></a>
</div>
<div class="section">
<div class="titlepage"><div><div><h2 class="title" style="clear: both">
<a name="boost_regex.partial_matches"></a><a class="link" href="partial_matches.html" title="Partial Matches">Partial Matches</a>
</h2></div></div></div>
<p>
The <a class="link" href="ref/match_flag_type.html" title="match_flag_type"><code class="computeroutput"><span class="identifier">match_flag_type</span></code></a>
<code class="computeroutput"><span class="identifier">match_partial</span></code> can be passed
to the following algorithms: <a class="link" href="ref/regex_match.html" title="regex_match"><code class="computeroutput"><span class="identifier">regex_match</span></code></a>, <a class="link" href="ref/regex_search.html" title="regex_search"><code class="computeroutput"><span class="identifier">regex_search</span></code></a>, and <a class="link" href="ref/deprecated/regex_grep.html" title="regex_grep (Deprecated)"><code class="computeroutput"><span class="identifier">regex_grep</span></code></a>, and used with the iterator
<a class="link" href="ref/regex_iterator.html" title="regex_iterator"><code class="computeroutput"><span class="identifier">regex_iterator</span></code></a>.
When used it indicates that partial as well as full matches should be found.
A partial match is one that matched one or more characters at the end of the
text input, but did not match all of the regular expression (although it may
have done so had more input been available). Partial matches are typically
used when either validating data input (checking each character as it is entered
on the keyboard), or when searching texts that are either too long to load
into memory (or even into a memory mapped file), or are of indeterminate length
(for example the source may be a socket or similar). Partial and full matches
can be differentiated as shown in the following table (the variable M represents
an instance of <a class="link" href="ref/match_results.html" title="match_results"><code class="computeroutput"><span class="identifier">match_results</span></code></a> as filled in by <a class="link" href="ref/regex_match.html" title="regex_match"><code class="computeroutput"><span class="identifier">regex_match</span></code></a>,
<a class="link" href="ref/regex_search.html" title="regex_search"><code class="computeroutput"><span class="identifier">regex_search</span></code></a>
or <a class="link" href="ref/deprecated/regex_grep.html" title="regex_grep (Deprecated)"><code class="computeroutput"><span class="identifier">regex_grep</span></code></a>):
</p>
<div class="informaltable"><table class="table">
<colgroup>
<col>
<col>
<col>
<col>
<col>
</colgroup>
<thead><tr>
<th>
</th>
<th>
<p>
Result
</p>
</th>
<th>
<p>
M[0].matched
</p>
</th>
<th>
<p>
M[0].first
</p>
</th>
<th>
<p>
M[0].second
</p>
</th>
</tr></thead>
<tbody>
<tr>
<td>
<p>
No match
</p>
</td>
<td>
<p>
False
</p>
</td>
<td>
<p>
Undefined
</p>
</td>
<td>
<p>
Undefined
</p>
</td>
<td>
<p>
Undefined
</p>
</td>
</tr>
<tr>
<td>
<p>
Partial match
</p>
</td>
<td>
<p>
True
</p>
</td>
<td>
<p>
False
</p>
</td>
<td>
<p>
Start of partial match.
</p>
</td>
<td>
<p>
End of partial match (end of text).
</p>
</td>
</tr>
<tr>
<td>
<p>
Full match
</p>
</td>
<td>
<p>
True
</p>
</td>
<td>
<p>
True
</p>
</td>
<td>
<p>
Start of full match.
</p>
</td>
<td>
<p>
End of full match.
</p>
</td>
</tr>
</tbody>
</table></div>
<p>
Be aware that using partial matches can sometimes result in somewhat imperfect
behavior:
</p>
<div class="itemizedlist"><ul class="itemizedlist" style="list-style-type: disc; ">
<li class="listitem">
There are some expressions, such as ".*abc" that will always
produce a partial match. This problem can be reduced by careful construction
of the regular expressions used, or by setting flags like match_not_dot_newline
so that expressions like .* can't match past line boundaries.
</li>
<li class="listitem">
Boost.Regex currently prefers leftmost matches to full matches, so for
example matching "abc|b" against "ab" produces a partial
match against the "ab" rather than a full match against "b".
It's more efficient to work this way, but may not be the behavior you want
in all situations.
</li>
<li class="listitem">
There are situations where full matches are found even though partial matches
are also possible: for example if the partial string terminates with "abc"
and the regular expression is "\w+", then a full match is found
even though there may be more alphabetical characters to come. This particular
case can be detected by checking if the match found terminates at the end
of current input string. However, there are situations where that is not
possible: for example an expression such as "abc.*123" may always
have longer matches available since it could conceivably match the entire
input string (no matter how long it may be).
</li>
</ul></div>
<p>
The following example tests to see whether the text could be a valid credit
card number, as the user presses a key, the character entered would be added
to the string being built up, and passed to <code class="computeroutput"><span class="identifier">is_possible_card_number</span></code>.
If this returns true then the text could be a valid card number, so the user
interface's OK button would be enabled. If it returns false, then this is not
yet a valid card number, but could be with more input, so the user interface
would disable the OK button. Finally, if the procedure throws an exception
the input could never become a valid number, and the inputted character must
be discarded, and a suitable error indication displayed to the user.
</p>
<pre class="programlisting"><span class="preprocessor">#include</span> <span class="special">&lt;</span><span class="identifier">string</span><span class="special">&gt;</span>
<span class="preprocessor">#include</span> <span class="special">&lt;</span><span class="identifier">iostream</span><span class="special">&gt;</span>
<span class="preprocessor">#include</span> <span class="special">&lt;</span><span class="identifier">boost</span><span class="special">/</span><span class="identifier">regex</span><span class="special">.</span><span class="identifier">hpp</span><span class="special">&gt;</span>
<span class="identifier">boost</span><span class="special">::</span><span class="identifier">regex</span> <span class="identifier">e</span><span class="special">(</span><span class="string">"(\\d{3,4})[- ]?(\\d{4})[- ]?(\\d{4})[- ]?(\\d{4})"</span><span class="special">);</span>
<span class="keyword">bool</span> <span class="identifier">is_possible_card_number</span><span class="special">(</span><span class="keyword">const</span> <span class="identifier">std</span><span class="special">::</span><span class="identifier">string</span><span class="special">&amp;</span> <span class="identifier">input</span><span class="special">)</span>
<span class="special">{</span>
<span class="comment">//</span>
<span class="comment">// return false for partial match, true for full match, or throw for</span>
<span class="comment">// impossible match based on what we have so far...</span>
<span class="identifier">boost</span><span class="special">::</span><span class="identifier">match_results</span><span class="special">&lt;</span><span class="identifier">std</span><span class="special">::</span><span class="identifier">string</span><span class="special">::</span><span class="identifier">const_iterator</span><span class="special">&gt;</span> <span class="identifier">what</span><span class="special">;</span>
<span class="keyword">if</span><span class="special">(</span><span class="number">0</span> <span class="special">==</span> <span class="identifier">boost</span><span class="special">::</span><span class="identifier">regex_match</span><span class="special">(</span><span class="identifier">input</span><span class="special">,</span> <span class="identifier">what</span><span class="special">,</span> <span class="identifier">e</span><span class="special">,</span> <span class="identifier">boost</span><span class="special">::</span><span class="identifier">match_default</span> <span class="special">|</span> <span class="identifier">boost</span><span class="special">::</span><span class="identifier">match_partial</span><span class="special">))</span>
<span class="special">{</span>
<span class="comment">// the input so far could not possibly be valid so reject it:</span>
<span class="keyword">throw</span> <span class="identifier">std</span><span class="special">::</span><span class="identifier">runtime_error</span><span class="special">(</span>
<span class="string">"Invalid data entered - this could not possibly be a valid card number"</span><span class="special">);</span>
<span class="special">}</span>
<span class="comment">// OK so far so good, but have we finished?</span>
<span class="keyword">if</span><span class="special">(</span><span class="identifier">what</span><span class="special">[</span><span class="number">0</span><span class="special">].</span><span class="identifier">matched</span><span class="special">)</span>
<span class="special">{</span>
<span class="comment">// excellent, we have a result:</span>
<span class="keyword">return</span> <span class="keyword">true</span><span class="special">;</span>
<span class="special">}</span>
<span class="comment">// what we have so far is only a partial match...</span>
<span class="keyword">return</span> <span class="keyword">false</span><span class="special">;</span>
<span class="special">}</span>
</pre>
<p>
In the following example, text input is taken from a stream containing an unknown
amount of text; this example simply counts the number of html tags encountered
in the stream. The text is loaded into a buffer and searched a part at a time,
if a partial match was encountered, then the partial match gets searched a
second time as the start of the next batch of text:
</p>
<pre class="programlisting"><span class="preprocessor">#include</span> <span class="special">&lt;</span><span class="identifier">iostream</span><span class="special">&gt;</span>
<span class="preprocessor">#include</span> <span class="special">&lt;</span><span class="identifier">fstream</span><span class="special">&gt;</span>
<span class="preprocessor">#include</span> <span class="special">&lt;</span><span class="identifier">sstream</span><span class="special">&gt;</span>
<span class="preprocessor">#include</span> <span class="special">&lt;</span><span class="identifier">string</span><span class="special">&gt;</span>
<span class="preprocessor">#include</span> <span class="special">&lt;</span><span class="identifier">boost</span><span class="special">/</span><span class="identifier">regex</span><span class="special">.</span><span class="identifier">hpp</span><span class="special">&gt;</span>
<span class="comment">// match some kind of html tag:</span>
<span class="identifier">boost</span><span class="special">::</span><span class="identifier">regex</span> <span class="identifier">e</span><span class="special">(</span><span class="string">"&lt;[^&gt;]*&gt;"</span><span class="special">);</span>
<span class="comment">// count how many:</span>
<span class="keyword">unsigned</span> <span class="keyword">int</span> <span class="identifier">tags</span> <span class="special">=</span> <span class="number">0</span><span class="special">;</span>
<span class="keyword">void</span> <span class="identifier">search</span><span class="special">(</span><span class="identifier">std</span><span class="special">::</span><span class="identifier">istream</span><span class="special">&amp;</span> <span class="identifier">is</span><span class="special">)</span>
<span class="special">{</span>
<span class="comment">// buffer we'll be searching in:</span>
<span class="keyword">char</span> <span class="identifier">buf</span><span class="special">[</span><span class="number">4096</span><span class="special">];</span>
<span class="comment">// saved position of end of partial match:</span>
<span class="keyword">const</span> <span class="keyword">char</span><span class="special">*</span> <span class="identifier">next_pos</span> <span class="special">=</span> <span class="identifier">buf</span> <span class="special">+</span> <span class="keyword">sizeof</span><span class="special">(</span><span class="identifier">buf</span><span class="special">);</span>
<span class="comment">// flag to indicate whether there is more input to come:</span>
<span class="keyword">bool</span> <span class="identifier">have_more</span> <span class="special">=</span> <span class="keyword">true</span><span class="special">;</span>
<span class="keyword">while</span><span class="special">(</span><span class="identifier">have_more</span><span class="special">)</span>
<span class="special">{</span>
<span class="comment">// how much do we copy forward from last try:</span>
<span class="keyword">unsigned</span> <span class="identifier">leftover</span> <span class="special">=</span> <span class="special">(</span><span class="identifier">buf</span> <span class="special">+</span> <span class="keyword">sizeof</span><span class="special">(</span><span class="identifier">buf</span><span class="special">))</span> <span class="special">-</span> <span class="identifier">next_pos</span><span class="special">;</span>
<span class="comment">// and how much is left to fill:</span>
<span class="keyword">unsigned</span> <span class="identifier">size</span> <span class="special">=</span> <span class="identifier">next_pos</span> <span class="special">-</span> <span class="identifier">buf</span><span class="special">;</span>
<span class="comment">// copy forward whatever we have left:</span>
<span class="identifier">std</span><span class="special">::</span><span class="identifier">memmove</span><span class="special">(</span><span class="identifier">buf</span><span class="special">,</span> <span class="identifier">next_pos</span><span class="special">,</span> <span class="identifier">leftover</span><span class="special">);</span>
<span class="comment">// fill the rest from the stream:</span>
<span class="identifier">is</span><span class="special">.</span><span class="identifier">read</span><span class="special">(</span><span class="identifier">buf</span> <span class="special">+</span> <span class="identifier">leftover</span><span class="special">,</span> <span class="identifier">size</span><span class="special">);</span>
<span class="keyword">unsigned</span> <span class="identifier">read</span> <span class="special">=</span> <span class="identifier">is</span><span class="special">.</span><span class="identifier">gcount</span><span class="special">();</span>
<span class="comment">// check to see if we've run out of text:</span>
<span class="identifier">have_more</span> <span class="special">=</span> <span class="identifier">read</span> <span class="special">==</span> <span class="identifier">size</span><span class="special">;</span>
<span class="comment">// reset next_pos:</span>
<span class="identifier">next_pos</span> <span class="special">=</span> <span class="identifier">buf</span> <span class="special">+</span> <span class="keyword">sizeof</span><span class="special">(</span><span class="identifier">buf</span><span class="special">);</span>
<span class="comment">// and then iterate:</span>
<span class="identifier">boost</span><span class="special">::</span><span class="identifier">cregex_iterator</span> <span class="identifier">a</span><span class="special">(</span>
<span class="identifier">buf</span><span class="special">,</span>
<span class="identifier">buf</span> <span class="special">+</span> <span class="identifier">read</span> <span class="special">+</span> <span class="identifier">leftover</span><span class="special">,</span>
<span class="identifier">e</span><span class="special">,</span>
<span class="identifier">boost</span><span class="special">::</span><span class="identifier">match_default</span> <span class="special">|</span> <span class="identifier">boost</span><span class="special">::</span><span class="identifier">match_partial</span><span class="special">);</span>
<span class="identifier">boost</span><span class="special">::</span><span class="identifier">cregex_iterator</span> <span class="identifier">b</span><span class="special">;</span>
<span class="keyword">while</span><span class="special">(</span><span class="identifier">a</span> <span class="special">!=</span> <span class="identifier">b</span><span class="special">)</span>
<span class="special">{</span>
<span class="keyword">if</span><span class="special">((*</span><span class="identifier">a</span><span class="special">)[</span><span class="number">0</span><span class="special">].</span><span class="identifier">matched</span> <span class="special">==</span> <span class="keyword">false</span><span class="special">)</span>
<span class="special">{</span>
<span class="comment">// Partial match, save position and break:</span>
<span class="identifier">next_pos</span> <span class="special">=</span> <span class="special">(*</span><span class="identifier">a</span><span class="special">)[</span><span class="number">0</span><span class="special">].</span><span class="identifier">first</span><span class="special">;</span>
<span class="keyword">break</span><span class="special">;</span>
<span class="special">}</span>
<span class="keyword">else</span>
<span class="special">{</span>
<span class="comment">// full match:</span>
<span class="special">++</span><span class="identifier">tags</span><span class="special">;</span>
<span class="special">}</span>
<span class="comment">// move to next match:</span>
<span class="special">++</span><span class="identifier">a</span><span class="special">;</span>
<span class="special">}</span>
<span class="special">}</span>
<span class="special">}</span>
</pre>
</div>
<table xmlns:rev="http://www.cs.rpi.edu/~gregod/boost/tools/doc/revision" width="100%"><tr>
<td align="left"></td>
<td align="right"><div class="copyright-footer">Copyright © 1998-2013 John Maddock<p>
Distributed under the Boost Software License, Version 1.0. (See accompanying
file LICENSE_1_0.txt or copy at <a href="http://www.boost.org/LICENSE_1_0.txt" target="_top">http://www.boost.org/LICENSE_1_0.txt</a>)
</p>
</div></td>
</tr></table>
<hr>
<div class="spirit-nav">
<a accesskey="p" href="captures.html"><img src="../../../../../doc/src/images/prev.png" alt="Prev"></a><a accesskey="u" href="../index.html"><img src="../../../../../doc/src/images/up.png" alt="Up"></a><a accesskey="h" href="../index.html"><img src="../../../../../doc/src/images/home.png" alt="Home"></a><a accesskey="n" href="syntax.html"><img src="../../../../../doc/src/images/next.png" alt="Next"></a>
</div>
</body>
</html>

View File

@ -0,0 +1,123 @@
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title>Reference</title>
<link rel="stylesheet" href="../../../../../doc/src/boostbook.css" type="text/css">
<meta name="generator" content="DocBook XSL Stylesheets V1.79.1">
<link rel="home" href="../index.html" title="Boost.Regex 7.0.1">
<link rel="up" href="../index.html" title="Boost.Regex 7.0.1">
<link rel="prev" href="format/boost_format_syntax.html" title="Boost-Extended Format String Syntax">
<link rel="next" href="ref/basic_regex.html" title="basic_regex">
</head>
<body bgcolor="white" text="black" link="#0000FF" vlink="#840084" alink="#0000FF">
<table cellpadding="2" width="100%"><tr>
<td valign="top"><img alt="Boost C++ Libraries" width="277" height="86" src="../../../../../boost.png"></td>
<td align="center"><a href="../../../../../index.html">Home</a></td>
<td align="center"><a href="../../../../../libs/libraries.htm">Libraries</a></td>
<td align="center"><a href="http://www.boost.org/users/people.html">People</a></td>
<td align="center"><a href="http://www.boost.org/users/faq.html">FAQ</a></td>
<td align="center"><a href="../../../../../more/index.htm">More</a></td>
</tr></table>
<hr>
<div class="spirit-nav">
<a accesskey="p" href="format/boost_format_syntax.html"><img src="../../../../../doc/src/images/prev.png" alt="Prev"></a><a accesskey="u" href="../index.html"><img src="../../../../../doc/src/images/up.png" alt="Up"></a><a accesskey="h" href="../index.html"><img src="../../../../../doc/src/images/home.png" alt="Home"></a><a accesskey="n" href="ref/basic_regex.html"><img src="../../../../../doc/src/images/next.png" alt="Next"></a>
</div>
<div class="section">
<div class="titlepage"><div><div><h2 class="title" style="clear: both">
<a name="boost_regex.ref"></a><a class="link" href="ref.html" title="Reference">Reference</a>
</h2></div></div></div>
<div class="toc"><dl class="toc">
<dt><span class="section"><a href="ref/basic_regex.html">basic_regex</a></span></dt>
<dt><span class="section"><a href="ref/match_results.html">match_results</a></span></dt>
<dt><span class="section"><a href="ref/sub_match.html">sub_match</a></span></dt>
<dt><span class="section"><a href="ref/regex_match.html">regex_match</a></span></dt>
<dt><span class="section"><a href="ref/regex_search.html">regex_search</a></span></dt>
<dt><span class="section"><a href="ref/regex_replace.html">regex_replace</a></span></dt>
<dt><span class="section"><a href="ref/regex_iterator.html">regex_iterator</a></span></dt>
<dt><span class="section"><a href="ref/regex_token_iterator.html">regex_token_iterator</a></span></dt>
<dt><span class="section"><a href="ref/bad_expression.html">bad_expression</a></span></dt>
<dt><span class="section"><a href="ref/syntax_option_type.html">syntax_option_type</a></span></dt>
<dd><dl>
<dt><span class="section"><a href="ref/syntax_option_type/syntax_option_type_synopsis.html">syntax_option_type
Synopsis</a></span></dt>
<dt><span class="section"><a href="ref/syntax_option_type/syntax_option_type_overview.html">Overview
of syntax_option_type</a></span></dt>
<dt><span class="section"><a href="ref/syntax_option_type/syntax_option_type_perl.html">Options
for Perl Regular Expressions</a></span></dt>
<dt><span class="section"><a href="ref/syntax_option_type/syntax_option_type_extended.html">Options
for POSIX Extended Regular Expressions</a></span></dt>
<dt><span class="section"><a href="ref/syntax_option_type/syntax_option_type_basic.html">Options
for POSIX Basic Regular Expressions</a></span></dt>
<dt><span class="section"><a href="ref/syntax_option_type/syntax_option_type_literal.html">Options
for Literal Strings</a></span></dt>
</dl></dd>
<dt><span class="section"><a href="ref/match_flag_type.html">match_flag_type</a></span></dt>
<dt><span class="section"><a href="ref/error_type.html">error_type</a></span></dt>
<dt><span class="section"><a href="ref/regex_traits.html">regex_traits</a></span></dt>
<dt><span class="section"><a href="ref/non_std_strings.html">Interfacing With Non-Standard
String Types</a></span></dt>
<dd><dl>
<dt><span class="section"><a href="ref/non_std_strings/icu.html">Working With Unicode
and ICU String Types</a></span></dt>
<dd><dl>
<dt><span class="section"><a href="ref/non_std_strings/icu/intro.html">Introduction
to using Regex with ICU</a></span></dt>
<dt><span class="section"><a href="ref/non_std_strings/icu/unicode_types.html">Unicode
regular expression types</a></span></dt>
<dt><span class="section"><a href="ref/non_std_strings/icu/unicode_algo.html">Unicode
Regular Expression Algorithms</a></span></dt>
<dt><span class="section"><a href="ref/non_std_strings/icu/unicode_iter.html">Unicode
Aware Regex Iterators</a></span></dt>
</dl></dd>
<dt><span class="section"><a href="ref/non_std_strings/mfc_strings.html">Using
Boost Regex With MFC Strings</a></span></dt>
<dd><dl>
<dt><span class="section"><a href="ref/non_std_strings/mfc_strings/mfc_intro.html">Introduction
to Boost.Regex and MFC Strings</a></span></dt>
<dt><span class="section"><a href="ref/non_std_strings/mfc_strings/mfc_regex_types.html">Regex
Types Used With MFC Strings</a></span></dt>
<dt><span class="section"><a href="ref/non_std_strings/mfc_strings/mfc_regex_create.html">Regular
Expression Creation From an MFC String</a></span></dt>
<dt><span class="section"><a href="ref/non_std_strings/mfc_strings/mfc_algo.html">Overloaded
Algorithms For MFC String Types</a></span></dt>
<dt><span class="section"><a href="ref/non_std_strings/mfc_strings/mfc_iter.html">Iterating
Over the Matches Within An MFC String</a></span></dt>
</dl></dd>
</dl></dd>
<dt><span class="section"><a href="ref/posix.html">POSIX Compatible C API's</a></span></dt>
<dt><span class="section"><a href="ref/concepts.html">Concepts</a></span></dt>
<dd><dl>
<dt><span class="section"><a href="ref/concepts/charT_concept.html">charT Requirements</a></span></dt>
<dt><span class="section"><a href="ref/concepts/traits_concept.html">Traits Class
Requirements</a></span></dt>
<dt><span class="section"><a href="ref/concepts/iterator_concepts.html">Iterator
Requirements</a></span></dt>
</dl></dd>
<dt><span class="section"><a href="ref/deprecated.html">Deprecated Interfaces</a></span></dt>
<dd><dl>
<dt><span class="section"><a href="ref/deprecated/regex_format.html">regex_format
(Deprecated)</a></span></dt>
<dt><span class="section"><a href="ref/deprecated/regex_grep.html">regex_grep (Deprecated)</a></span></dt>
<dt><span class="section"><a href="ref/deprecated/regex_split.html">regex_split
(deprecated)</a></span></dt>
<dt><span class="section"><a href="ref/deprecated/old_regex.html">High Level Class
RegEx (Deprecated)</a></span></dt>
</dl></dd>
<dt><span class="section"><a href="ref/internals.html">Internal Details</a></span></dt>
<dd><dl><dt><span class="section"><a href="ref/internals/uni_iter.html">Unicode Iterators</a></span></dt></dl></dd>
</dl></div>
</div>
<table xmlns:rev="http://www.cs.rpi.edu/~gregod/boost/tools/doc/revision" width="100%"><tr>
<td align="left"></td>
<td align="right"><div class="copyright-footer">Copyright © 1998-2013 John Maddock<p>
Distributed under the Boost Software License, Version 1.0. (See accompanying
file LICENSE_1_0.txt or copy at <a href="http://www.boost.org/LICENSE_1_0.txt" target="_top">http://www.boost.org/LICENSE_1_0.txt</a>)
</p>
</div></td>
</tr></table>
<hr>
<div class="spirit-nav">
<a accesskey="p" href="format/boost_format_syntax.html"><img src="../../../../../doc/src/images/prev.png" alt="Prev"></a><a accesskey="u" href="../index.html"><img src="../../../../../doc/src/images/up.png" alt="Up"></a><a accesskey="h" href="../index.html"><img src="../../../../../doc/src/images/home.png" alt="Home"></a><a accesskey="n" href="ref/basic_regex.html"><img src="../../../../../doc/src/images/next.png" alt="Next"></a>
</div>
</body>
</html>

View File

@ -0,0 +1,103 @@
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title>bad_expression</title>
<link rel="stylesheet" href="../../../../../../doc/src/boostbook.css" type="text/css">
<meta name="generator" content="DocBook XSL Stylesheets V1.79.1">
<link rel="home" href="../../index.html" title="Boost.Regex 7.0.1">
<link rel="up" href="../ref.html" title="Reference">
<link rel="prev" href="regex_token_iterator.html" title="regex_token_iterator">
<link rel="next" href="syntax_option_type.html" title="syntax_option_type">
</head>
<body bgcolor="white" text="black" link="#0000FF" vlink="#840084" alink="#0000FF">
<table cellpadding="2" width="100%"><tr>
<td valign="top"><img alt="Boost C++ Libraries" width="277" height="86" src="../../../../../../boost.png"></td>
<td align="center"><a href="../../../../../../index.html">Home</a></td>
<td align="center"><a href="../../../../../../libs/libraries.htm">Libraries</a></td>
<td align="center"><a href="http://www.boost.org/users/people.html">People</a></td>
<td align="center"><a href="http://www.boost.org/users/faq.html">FAQ</a></td>
<td align="center"><a href="../../../../../../more/index.htm">More</a></td>
</tr></table>
<hr>
<div class="spirit-nav">
<a accesskey="p" href="regex_token_iterator.html"><img src="../../../../../../doc/src/images/prev.png" alt="Prev"></a><a accesskey="u" href="../ref.html"><img src="../../../../../../doc/src/images/up.png" alt="Up"></a><a accesskey="h" href="../../index.html"><img src="../../../../../../doc/src/images/home.png" alt="Home"></a><a accesskey="n" href="syntax_option_type.html"><img src="../../../../../../doc/src/images/next.png" alt="Next"></a>
</div>
<div class="section">
<div class="titlepage"><div><div><h3 class="title">
<a name="boost_regex.ref.bad_expression"></a><a class="link" href="bad_expression.html" title="bad_expression">bad_expression</a>
</h3></div></div></div>
<h5>
<a name="boost_regex.ref.bad_expression.h0"></a>
<span class="phrase"><a name="boost_regex.ref.bad_expression.synopsis"></a></span><a class="link" href="bad_expression.html#boost_regex.ref.bad_expression.synopsis">Synopsis</a>
</h5>
<pre class="programlisting"><span class="preprocessor">#include</span> <span class="special">&lt;</span><span class="identifier">boost</span><span class="special">/</span><span class="identifier">pattern_except</span><span class="special">.</span><span class="identifier">hpp</span><span class="special">&gt;</span>
</pre>
<p>
The class <code class="computeroutput"><span class="identifier">regex_error</span></code> defines
the type of objects thrown as exceptions to report errors during the conversion
from a string representing a regular expression to a finite state machine.
</p>
<pre class="programlisting"><span class="keyword">namespace</span> <span class="identifier">boost</span><span class="special">{</span>
<span class="keyword">class</span> <span class="identifier">regex_error</span> <span class="special">:</span> <span class="keyword">public</span> <span class="identifier">std</span><span class="special">::</span><span class="identifier">runtime_error</span>
<span class="special">{</span>
<span class="keyword">public</span><span class="special">:</span>
<span class="keyword">explicit</span> <span class="identifier">regex_error</span><span class="special">(</span><span class="keyword">const</span> <span class="identifier">std</span><span class="special">::</span><span class="identifier">string</span><span class="special">&amp;</span> <span class="identifier">s</span><span class="special">,</span> <span class="identifier">regex_constants</span><span class="special">::</span><span class="identifier">error_type</span> <span class="identifier">err</span><span class="special">,</span> <span class="identifier">std</span><span class="special">::</span><span class="identifier">ptrdiff_t</span> <span class="identifier">pos</span><span class="special">);</span>
<span class="keyword">explicit</span> <span class="identifier">regex_error</span><span class="special">(</span><span class="identifier">boost</span><span class="special">::</span><span class="identifier">regex_constants</span><span class="special">::</span><span class="identifier">error_type</span> <span class="identifier">err</span><span class="special">);</span>
<span class="identifier">boost</span><span class="special">::</span><span class="identifier">regex_constants</span><span class="special">::</span><span class="identifier">error_type</span> <span class="identifier">code</span><span class="special">()</span><span class="keyword">const</span><span class="special">;</span>
<span class="identifier">std</span><span class="special">::</span><span class="identifier">ptrdiff_t</span> <span class="identifier">position</span><span class="special">()</span><span class="keyword">const</span><span class="special">;</span>
<span class="special">};</span>
<span class="keyword">typedef</span> <span class="identifier">regex_error</span> <span class="identifier">bad_pattern</span><span class="special">;</span> <span class="comment">// for backwards compatibility</span>
<span class="keyword">typedef</span> <span class="identifier">regex_error</span> <span class="identifier">bad_expression</span><span class="special">;</span> <span class="comment">// for backwards compatibility</span>
<span class="special">}</span> <span class="comment">// namespace boost</span>
</pre>
<h5>
<a name="boost_regex.ref.bad_expression.h1"></a>
<span class="phrase"><a name="boost_regex.ref.bad_expression.description"></a></span><a class="link" href="bad_expression.html#boost_regex.ref.bad_expression.description">Description</a>
</h5>
<pre class="programlisting"><span class="identifier">regex_error</span><span class="special">(</span><span class="keyword">const</span> <span class="identifier">std</span><span class="special">::</span><span class="identifier">string</span><span class="special">&amp;</span> <span class="identifier">s</span><span class="special">,</span> <span class="identifier">regex_constants</span><span class="special">::</span><span class="identifier">error_type</span> <span class="identifier">err</span><span class="special">,</span> <span class="identifier">std</span><span class="special">::</span><span class="identifier">ptrdiff_t</span> <span class="identifier">pos</span><span class="special">);</span>
<span class="identifier">regex_error</span><span class="special">(</span><span class="identifier">boost</span><span class="special">::</span><span class="identifier">regex_constants</span><span class="special">::</span><span class="identifier">error_type</span> <span class="identifier">err</span><span class="special">);</span>
</pre>
<p>
<span class="bold"><strong>Effects:</strong></span> Constructs an object of class regex_error.
</p>
<pre class="programlisting"><span class="identifier">boost</span><span class="special">::</span><span class="identifier">regex_constants</span><span class="special">::</span><span class="identifier">error_type</span> <span class="identifier">code</span><span class="special">()</span><span class="keyword">const</span><span class="special">;</span>
</pre>
<p>
<span class="bold"><strong>Effects:</strong></span> returns the error code that represents
parsing error that occurred.
</p>
<pre class="programlisting"><span class="identifier">std</span><span class="special">::</span><span class="identifier">ptrdiff_t</span> <span class="identifier">position</span><span class="special">()</span><span class="keyword">const</span><span class="special">;</span>
</pre>
<p>
<span class="bold"><strong>Effects:</strong></span> returns the location in the expression
where parsing stopped.
</p>
<p>
Footnotes: the choice of <code class="computeroutput"><span class="identifier">std</span><span class="special">::</span><span class="identifier">runtime_error</span></code>
as the base class for <code class="computeroutput"><span class="identifier">regex_error</span></code>
is moot; depending upon how the library is used exceptions may be either
logic errors (programmer supplied expressions) or run time errors (user supplied
expressions). The library previously used <code class="computeroutput"><span class="identifier">bad_pattern</span></code>
and <code class="computeroutput"><span class="identifier">bad_expression</span></code> for errors,
these have been replaced by the single class <code class="computeroutput"><span class="identifier">regex_error</span></code>
to keep the library in synchronization with the <a href="http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2005/n1836.pdf" target="_top">Technical
Report on C++ Library Extensions</a>.
</p>
</div>
<table xmlns:rev="http://www.cs.rpi.edu/~gregod/boost/tools/doc/revision" width="100%"><tr>
<td align="left"></td>
<td align="right"><div class="copyright-footer">Copyright © 1998-2013 John Maddock<p>
Distributed under the Boost Software License, Version 1.0. (See accompanying
file LICENSE_1_0.txt or copy at <a href="http://www.boost.org/LICENSE_1_0.txt" target="_top">http://www.boost.org/LICENSE_1_0.txt</a>)
</p>
</div></td>
</tr></table>
<hr>
<div class="spirit-nav">
<a accesskey="p" href="regex_token_iterator.html"><img src="../../../../../../doc/src/images/prev.png" alt="Prev"></a><a accesskey="u" href="../ref.html"><img src="../../../../../../doc/src/images/up.png" alt="Up"></a><a accesskey="h" href="../../index.html"><img src="../../../../../../doc/src/images/home.png" alt="Home"></a><a accesskey="n" href="syntax_option_type.html"><img src="../../../../../../doc/src/images/next.png" alt="Next"></a>
</div>
</body>
</html>

File diff suppressed because it is too large Load Diff

Some files were not shown because too many files have changed in this diff Show More