From 142d4434e405c51e6bb200f10a2bad046b595f04 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Daniel=20Kr=C3=BCgler?=
Date: Sun, 8 Aug 2021 18:29:12 +0200
Subject: [PATCH 01/20] #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
---
include/boost/regex/v4/icu.hpp | 2 +-
include/boost/regex/v5/icu.hpp | 2 +-
2 files changed, 2 insertions(+), 2 deletions(-)
diff --git a/include/boost/regex/v4/icu.hpp b/include/boost/regex/v4/icu.hpp
index 9724b0f8..7e70f57e 100644
--- a/include/boost/regex/v4/icu.hpp
+++ b/include/boost/regex/v4/icu.hpp
@@ -187,7 +187,7 @@ namespace boost {
}
char_type translate_nocase(char_type c) const
{
- return ::u_tolower(c);
+ return ::u_foldCase(c, U_FOLD_CASE_DEFAULT);
}
char_type translate(char_type c, bool icase) const
{
diff --git a/include/boost/regex/v5/icu.hpp b/include/boost/regex/v5/icu.hpp
index a9264965..f172553d 100644
--- a/include/boost/regex/v5/icu.hpp
+++ b/include/boost/regex/v5/icu.hpp
@@ -161,7 +161,7 @@ public:
}
char_type translate_nocase(char_type c) const
{
- return ::u_tolower(c);
+ return ::u_foldCase(c, U_FOLD_CASE_DEFAULT);
}
char_type translate(char_type c, bool icase) const
{
From 5ad8906e91efd76cae8365ec7de34434b67a3ca2 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Daniel=20Kr=C3=BCgler?=
Date: Sun, 8 Aug 2021 18:29:12 +0200
Subject: [PATCH 02/20] #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
---
include/boost/regex/v4/icu.hpp | 2 +-
include/boost/regex/v5/icu.hpp | 2 +-
test/Jamfile.v2 | 3 +
test/unicode/unicode_casefold_test.cpp | 204 +++++++++++++++++++++++++
4 files changed, 209 insertions(+), 2 deletions(-)
create mode 100644 test/unicode/unicode_casefold_test.cpp
diff --git a/include/boost/regex/v4/icu.hpp b/include/boost/regex/v4/icu.hpp
index 9724b0f8..7e70f57e 100644
--- a/include/boost/regex/v4/icu.hpp
+++ b/include/boost/regex/v4/icu.hpp
@@ -187,7 +187,7 @@ namespace boost {
}
char_type translate_nocase(char_type c) const
{
- return ::u_tolower(c);
+ return ::u_foldCase(c, U_FOLD_CASE_DEFAULT);
}
char_type translate(char_type c, bool icase) const
{
diff --git a/include/boost/regex/v5/icu.hpp b/include/boost/regex/v5/icu.hpp
index a9264965..f172553d 100644
--- a/include/boost/regex/v5/icu.hpp
+++ b/include/boost/regex/v5/icu.hpp
@@ -161,7 +161,7 @@ public:
}
char_type translate_nocase(char_type c) const
{
- return ::u_tolower(c);
+ return ::u_foldCase(c, U_FOLD_CASE_DEFAULT);
}
char_type translate(char_type c, bool icase) const
{
diff --git a/test/Jamfile.v2 b/test/Jamfile.v2
index 9cef46b7..9a50918c 100644
--- a/test/Jamfile.v2
+++ b/test/Jamfile.v2
@@ -122,6 +122,9 @@ test-suite regex
[ run unicode/unicode_iterator_test.cpp : : :
[ check-target-builds ../build//is_legacy_03 : : ../build//boost_regex ]
release TEST_UTF16 : unicode_iterator_test_utf16 ]
+ [ run unicode/unicode_casefold_test.cpp
+ ../build//boost_regex ../build//icu_options
+ ]
[ run static_mutex/static_mutex_test.cpp
../../thread/build//boost_thread ../build//boost_regex
]
diff --git a/test/unicode/unicode_casefold_test.cpp b/test/unicode/unicode_casefold_test.cpp
new file mode 100644
index 00000000..d1597c81
--- /dev/null
+++ b/test/unicode/unicode_casefold_test.cpp
@@ -0,0 +1,204 @@
+/*
+ *
+ * Copyright (c) 2021 John Maddock
+ * Copyright (c) 2021 Daniel Kruegler
+ *
+ * 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)
+ *
+ */
+
+ /*
+ * LOCATION: see http://www.boost.org for most recent version.
+ * FILE unicode_casefold_test.cpp
+ * VERSION see
+ * DESCRIPTION: Simple test suite for Unicode case folding.
+ */
+
+#include
+#include
+#include "../test_macros.hpp"
+
+#if defined(BOOST_HAS_ICU)
+
+#include
+
+#include
+
+#include
+#include
+
+typedef std::pair unicode_verinfo;
+
+// Function to query the effective Unicode major and minor
+// version, because some spot test cases can only be tested
+// for specific Unicode versions.
+unicode_verinfo get_unicode_version()
+{
+ UVersionInfo versionArray = {};
+ u_getUnicodeVersion(versionArray);
+ unicode_verinfo result(versionArray[0] , versionArray[1]);
+ return result;
+}
+
+void latin_1_checks()
+{
+ typedef boost::icu_regex_traits traits_type;
+ traits_type traits;
+
+ // Test range [U+0000, U+0041): Identity fold
+ for (traits_type::char_type c = 0x0; c < 0x41; ++c)
+ {
+ traits_type::char_type nc = traits.translate_nocase(c);
+ BOOST_CHECK_EQUAL(nc, c);
+ }
+
+ // Test ASCII upper case letters [A, Z]: Each character folds
+ // to its lowercase variant:
+ for (traits_type::char_type c = 0x41; c <= 0x5A; ++c)
+ {
+ traits_type::char_type nc = traits.translate_nocase(c);
+ const int shift = 0x61 - 0x41;
+ BOOST_CHECK_EQUAL(nc, c + shift);
+ BOOST_CHECK_EQUAL(nc, traits.tolower(c));
+ }
+
+ // Test range (U+005A, U+00B5): Identity fold
+ for (traits_type::char_type c = 0x5A + 1; c < 0xB5; ++c)
+ {
+ traits_type::char_type nc = traits.translate_nocase(c);
+ BOOST_CHECK_EQUAL(nc, c);
+ }
+
+ // U+00B5 maps to its decomposition GREEK SMALL LETTER MU
+ // (U+03BC):
+ {
+ traits_type::char_type c = 0xB5;
+ traits_type::char_type nc = traits.translate_nocase(c);
+ BOOST_CHECK_EQUAL(nc, 0x03BC);
+ }
+
+ // Test range (U+00B5, U+00BF]: Identity fold
+ for (traits_type::char_type c = 0xB5 + 1; c <= 0xBF; ++c)
+ {
+ traits_type::char_type nc = traits.translate_nocase(c);
+ BOOST_CHECK_EQUAL(nc, c);
+ }
+
+ // Test range [U+00C0, U+00D6]: Each character folds
+ // to its lowercase variant:
+ for (traits_type::char_type c = 0xC0; c <= 0xD6; ++c)
+ {
+ traits_type::char_type nc = traits.translate_nocase(c);
+ traits_type::char_type lc = traits.tolower(c);
+ BOOST_CHECK_EQUAL(nc, lc);
+ BOOST_CHECK_NE(nc, c);
+ }
+
+ // U+00D7: Identity fold
+ {
+ traits_type::char_type c = 0xD7;
+ traits_type::char_type nc = traits.translate_nocase(c);
+ BOOST_CHECK_EQUAL(nc, c);
+ }
+
+ // Test range [U+00D8, U+00DE]: Each character folds
+ // to its lowercase variant:
+ for (traits_type::char_type c = 0xD8; c <= 0xDE; ++c)
+ {
+ traits_type::char_type nc = traits.translate_nocase(c);
+ traits_type::char_type lc = traits.tolower(c);
+ BOOST_CHECK_EQUAL(nc, lc);
+ BOOST_CHECK_NE(nc, c);
+ }
+
+ // Test range [U+00DF, U+00BF]: Identity fold
+ // Note that case folding of U+00DF (LATIN SMALL
+ // LETTER SHARP S) does not fold to U+1E9E (LATIN
+ // CAPITAL LETTER SHARP S) due to case folding
+ // stability contract
+ for (traits_type::char_type c = 0xDF; c <= 0xFF; ++c)
+ {
+ traits_type::char_type nc = traits.translate_nocase(c);
+ BOOST_CHECK_EQUAL(nc, c);
+ }
+}
+
+void spot_checks()
+{
+ // test specific values ripped straight out of the Unicode standard
+ // to verify that our case folding is the same as theirs:
+ typedef boost::icu_regex_traits traits_type;
+ traits_type traits;
+
+ const unicode_verinfo unicode_version = get_unicode_version();
+
+ // 'LATIN CAPITAL LETTER SHARP S' folds to
+ // 'LATIN SMALL LETTER SHARP S'
+ if (unicode_version >= unicode_verinfo(5, 1))
+ {
+ traits_type::char_type c = 0x1E9E;
+ traits_type::char_type nc = traits.translate_nocase(c);
+ traits_type::char_type lc = traits.tolower(c);
+ BOOST_CHECK_EQUAL(nc, lc);
+ BOOST_CHECK_EQUAL(nc, 0xDF);
+ }
+
+ // Capital sigma (U+03A3) is the uppercase form of both the regular (U+03C2)
+ // and final (U+03C3) lowercase sigma. All these characters exists since
+ // Unicode 1.1.0.
+ {
+ traits_type::char_type c = 0x03A3;
+ traits_type::char_type nc = traits.translate_nocase(c);
+ traits_type::char_type lc = traits.tolower(c);
+ BOOST_CHECK_EQUAL(nc, lc);
+ BOOST_CHECK_EQUAL(nc, 0x03C3);
+ c = 0x03C2;
+ nc = traits.translate_nocase(c);
+ BOOST_CHECK_EQUAL(nc, 0x03C3);
+ c = 0x03C3;
+ nc = traits.translate_nocase(c);
+ BOOST_CHECK_EQUAL(nc, c);
+ }
+
+ // In Turkish languages the lowercase letter 'i' (U+0069) maps to an
+ // uppercase dotted I (U+0130 LATIN CAPITAL LETTER I WITH DOT ABOVE),
+ // while the uppercase letter 'I' (U+0049) maps to the dotless lowercase
+ // i (U+0131). The Unicode simple default mapping folds U+0130 to itself,
+ // but folds U+0049 to U+0069.
+ {
+ traits_type::char_type c = 0x0130;
+ traits_type::char_type nc = traits.translate_nocase(c);
+ BOOST_CHECK_EQUAL(nc, c);
+ c = 0x0049;
+ nc = traits.translate_nocase(c);
+ traits_type::char_type lc = traits.tolower(c);
+ BOOST_CHECK_EQUAL(nc, lc);
+ BOOST_CHECK_EQUAL(nc, 0x0069);
+ }
+
+ // Cherokee small letters were added with Unicode 8.0,
+ // but the upper case letters existed before, therefore
+ // the small letters case fold to upper case letters.
+ if (unicode_version >= unicode_verinfo(8, 0))
+ {
+ traits_type::char_type c = 0x13F8;
+ traits_type::char_type nc = traits.translate_nocase(c);
+ traits_type::char_type uc = traits.toupper(c);
+ BOOST_CHECK_EQUAL(nc, uc);
+ BOOST_CHECK_EQUAL(nc, 0x13F0);
+ }
+
+}
+
+#endif
+
+int cpp_main( int, char* [] )
+{
+#if defined(BOOST_HAS_ICU)
+ latin_1_checks();
+ spot_checks();
+#endif
+ return boost::report_errors();
+}
From 248c69d68b809ff08ed5148ebaa9fffeb2d0d881 Mon Sep 17 00:00:00 2001
From: zhangyiru <877061968@qq.com>
Date: Sat, 18 Sep 2021 14:26:14 +0800
Subject: [PATCH 03/20] increase used_block_count when use put_mem_block
increase used_block_count when use put_mem_block in unwind_extra_block
---
include/boost/regex/v5/perl_matcher_non_recursive.hpp | 1 +
1 file changed, 1 insertion(+)
diff --git a/include/boost/regex/v5/perl_matcher_non_recursive.hpp b/include/boost/regex/v5/perl_matcher_non_recursive.hpp
index 1d2f0a53..146eb327 100644
--- a/include/boost/regex/v5/perl_matcher_non_recursive.hpp
+++ b/include/boost/regex/v5/perl_matcher_non_recursive.hpp
@@ -1353,6 +1353,7 @@ bool perl_matcher::unwind_repeater_counter(bool
template
bool perl_matcher::unwind_extra_block(bool)
{
+ ++used_block_count;
saved_extra_block* pmp = static_cast(m_backup_state);
void* condemmed = m_stack_base;
m_stack_base = pmp->base;
From e68f82c346f17208cfc230394be47a6fc87818f1 Mon Sep 17 00:00:00 2001
From: jzmaddock
Date: Tue, 5 Oct 2021 19:55:01 +0100
Subject: [PATCH 04/20] Remove windows.h dependency.
---
include/boost/regex/v5/w32_regex_traits.hpp | 339 ++++++++++++++------
1 file changed, 235 insertions(+), 104 deletions(-)
diff --git a/include/boost/regex/v5/w32_regex_traits.hpp b/include/boost/regex/v5/w32_regex_traits.hpp
index 5a9e93b6..16f7ee4e 100644
--- a/include/boost/regex/v5/w32_regex_traits.hpp
+++ b/include/boost/regex/v5/w32_regex_traits.hpp
@@ -29,14 +29,6 @@
#include
#include
-#ifndef VC_EXTRALEAN
-# define VC_EXTRALEAN
-#endif
-#ifndef WIN32_LEAN_AND_MEAN
-# define WIN32_LEAN_AND_MEAN
-#endif
-#include
-
#if defined(_MSC_VER) && !defined(_WIN32_WCE) && !defined(UNDER_CE)
#pragma comment(lib, "user32.lib")
#endif
@@ -49,6 +41,31 @@
#endif
#endif
+#ifndef BASETYPES
+//
+// windows.h not included, so lets forward declare what we need:
+//
+#ifndef NO_STRICT
+#ifndef STRICT
+#define STRICT 1
+#endif
+#endif
+
+#if defined(STRICT)
+#define BOOST_RE_DETAIL_DECLARE_HANDLE(x) struct x##__; typedef struct x##__ *x
+#else
+#define BOOST_RE_DETAIL_DECLARE_HANDLE(x) typedef void* x
+#endif
+//
+// This must be in the global namespace:
+//
+extern "C" {
+
+ BOOST_RE_DETAIL_DECLARE_HANDLE(HINSTANCE);
+ typedef HINSTANCE HMODULE;
+}
+#endif
+
namespace boost{
//
@@ -62,7 +79,7 @@ namespace BOOST_REGEX_DETAIL_NS{
//
// start by typedeffing the types we'll need:
//
-typedef std::uint32_t lcid_type; // placeholder for LCID.
+typedef unsigned long lcid_type; // placeholder for LCID.
typedef std::shared_ptr cat_type; // placeholder for dll HANDLE.
//
@@ -97,6 +114,125 @@ wchar_t w32_toupper(wchar_t c, lcid_type);
bool w32_is(lcid_type, std::uint32_t mask, char c);
#ifndef BOOST_NO_WREGEX
bool w32_is(lcid_type, std::uint32_t mask, wchar_t c);
+#endif
+
+#ifndef BASETYPES
+//
+// Forward declarations of the small number of windows types and API's we use:
+//
+
+#if !defined(__LP64__)
+using dword = unsigned long;
+#else
+using DWORD = unsigned int;
+#endif
+using word = unsigned short;
+using lctype = dword;
+
+static constexpr dword ct_ctype1 = 0x00000001;
+static constexpr dword c1_upper = 0x0001; // upper case
+static constexpr dword c1_lower = 0x0002; // lower case
+static constexpr dword c1_digit = 0x0004; // decimal digits
+static constexpr dword c1_space = 0x0008; // spacing characters
+static constexpr dword c1_punct = 0x0010; // punctuation characters
+static constexpr dword c1_cntrl = 0x0020; // control characters
+static constexpr dword c1_blank = 0x0040; // blank characters
+static constexpr dword c1_xdigit = 0x0080; // other digits
+static constexpr dword c1_alpha = 0x0100; // any linguistic character
+static constexpr dword c1_defined = 0x0200; // defined character
+static constexpr unsigned int cp_acp = 0;
+static constexpr dword lcmap_lowercase = 0x00000100;
+static constexpr dword lcmap_uppercase = 0x00000200;
+static constexpr dword lcmap_sortkey = 0x00000400; // WC sort key (normalize)
+static constexpr lctype locale_idefaultansicodepage = 0x00001004;
+
+# ifdef UNDER_CE
+# ifndef WINAPI
+# ifndef _WIN32_WCE_EMULATION
+# define BOOST_RE_STDCALL __cdecl // Note this doesn't match the desktop definition
+# else
+# define BOOST_RE_STDCALL __stdcall
+# endif
+# endif
+# else
+# if defined(_M_IX86) || defined(__i386__)
+# define BOOST_RE_STDCALL __stdcall
+# else
+ // On architectures other than 32-bit x86 __stdcall is ignored. Clang also issues a warning.
+# define BOOST_RE_STDCALL
+# endif
+# endif
+
+#if defined (WIN32_PLATFORM_PSPC)
+#define BOOST_RE_IMPORT __declspec( dllimport )
+#elif defined (_WIN32_WCE)
+#define BOOST_RE_IMPORT
+#else
+#define BOOST_RE_IMPORT __declspec( dllimport )
+#endif
+
+extern "C" {
+
+ BOOST_RE_IMPORT int BOOST_RE_STDCALL FreeLibrary(HMODULE hLibModule);
+ BOOST_RE_IMPORT int BOOST_RE_STDCALL LCMapStringA(lcid_type Locale, dword dwMapFlags, const char* lpSrcStr, int cchSrc, char* lpDestStr, int cchDest);
+ BOOST_RE_IMPORT int BOOST_RE_STDCALL LCMapStringW(lcid_type Locale, dword dwMapFlags, const wchar_t* lpSrcStr, int cchSrc, wchar_t* lpDestStr, int cchDest);
+ BOOST_RE_IMPORT int BOOST_RE_STDCALL MultiByteToWideChar(unsigned int CodePage, dword dwFlags, const char* lpMultiByteStr, int cbMultiByte, wchar_t* lpWideCharStr, int cchWideChar);
+ BOOST_RE_IMPORT int BOOST_RE_STDCALL LCMapStringW(lcid_type Locale, dword dwMapFlags, const wchar_t* lpSrcStr, int cchSrc, wchar_t* lpDestStr, int cchDest);
+ BOOST_RE_IMPORT int BOOST_RE_STDCALL WideCharToMultiByte(unsigned int CodePage, dword dwFlags, const wchar_t* lpWideCharStr, int cchWideChar, char* lpMultiByteStr, int cbMultiByte, const char* lpDefaultChar, int* lpUsedDefaultChar);
+ BOOST_RE_IMPORT int BOOST_RE_STDCALL GetStringTypeExA(lcid_type Locale, dword dwInfoType, const char* lpSrcStr, int cchSrc, word* lpCharType);
+ BOOST_RE_IMPORT int BOOST_RE_STDCALL GetStringTypeExW(lcid_type Locale, dword dwInfoType, const wchar_t* lpSrcStr, int cchSrc, word* lpCharType);
+ BOOST_RE_IMPORT lcid_type BOOST_RE_STDCALL GetUserDefaultLCID();
+ BOOST_RE_IMPORT int BOOST_RE_STDCALL GetStringTypeExA(lcid_type Locale, dword dwInfoType, const char* lpSrcStr, int cchSrc, word* lpCharType);
+ BOOST_RE_IMPORT int BOOST_RE_STDCALL GetStringTypeExW(lcid_type Locale, dword dwInfoType, const wchar_t* lpSrcStr, int cchSrc, word* lpCharType);
+ BOOST_RE_IMPORT HMODULE BOOST_RE_STDCALL LoadLibraryA(const char* lpLibFileName);
+ BOOST_RE_IMPORT HMODULE BOOST_RE_STDCALL LoadLibraryW(const wchar_t* lpLibFileName);
+ BOOST_RE_IMPORT int BOOST_RE_STDCALL LoadStringW(HINSTANCE hInstance, unsigned int uID, wchar_t* lpBuffer, int cchBufferMax);
+ BOOST_RE_IMPORT int BOOST_RE_STDCALL LoadStringA(HINSTANCE hInstance, unsigned int uID, char* lpBuffer, int cchBufferMax);
+ BOOST_RE_IMPORT int BOOST_RE_STDCALL GetLocaleInfoW(lcid_type Locale, lctype LCType, wchar_t* lpLCData, int cchData);
+}
+
+#else
+//
+// We have windows.h already included:
+//
+using dword = DWORD;
+using word = WORD;
+using lctype = LCTYPE;
+
+static constexpr dword ct_ctype1 = 0x00000001;
+static constexpr dword c1_upper = 0x0001; // upper case
+static constexpr dword c1_lower = 0x0002; // lower case
+static constexpr dword c1_digit = 0x0004; // decimal digits
+static constexpr dword c1_space = 0x0008; // spacing characters
+static constexpr dword c1_punct = 0x0010; // punctuation characters
+static constexpr dword c1_cntrl = 0x0020; // control characters
+static constexpr dword c1_blank = 0x0040; // blank characters
+static constexpr dword c1_xdigit = 0x0080; // other digits
+static constexpr dword c1_alpha = 0x0100; // any linguistic character
+static constexpr dword c1_defined = 0x0200; // defined character
+static constexpr unsigned int cp_acp = 0;
+static constexpr dword lcmap_lowercase = 0x00000100;
+static constexpr dword lcmap_uppercase = 0x00000200;
+static constexpr dword lcmap_sortkey = 0x00000400; // WC sort key (normalize)
+static constexpr lctype locale_idefaultansicodepage = 0x00001004;
+
+using ::FreeLibrary;
+using ::LCMapStringA;
+using ::LCMapStringW;
+using ::MultiByteToWideChar;
+using ::LCMapStringW;
+using ::WideCharToMultiByte;
+using ::GetStringTypeExA;
+using ::GetStringTypeExW;
+using ::GetUserDefaultLCID;
+using ::GetStringTypeExA;
+using ::GetStringTypeExW;
+using ::LoadLibraryA;
+using ::LoadLibraryW;
+using ::LoadStringW;
+using ::LoadStringA;
+using ::GetLocaleInfoW;
+
#endif
//
// class w32_regex_traits_base:
@@ -679,13 +815,13 @@ std::mutex& w32_regex_traits::get_mutex_inst()
namespace BOOST_REGEX_DETAIL_NS {
#ifdef BOOST_NO_ANSI_APIS
- inline UINT get_code_page_for_locale_id(lcid_type idx)
+ inline unsigned int get_code_page_for_locale_id(lcid_type idx)
{
- WCHAR code_page_string[7];
- if (::GetLocaleInfoW(idx, LOCALE_IDEFAULTANSICODEPAGE, code_page_string, 7) == 0)
+ wchar_t code_page_string[7];
+ if (boost::BOOST_REGEX_DETAIL_NS::GetLocaleInfoW(idx, locale_idefaultansicodepage, code_page_string, 7) == 0)
return 0;
- return static_cast(_wtol(code_page_string));
+ return static_cast(_wtol(code_page_string));
}
#endif
@@ -755,21 +891,21 @@ namespace BOOST_REGEX_DETAIL_NS {
for (int ii = 0; ii < (1 << CHAR_BIT); ++ii)
char_map[ii] = static_cast(ii);
#ifndef BOOST_NO_ANSI_APIS
- int r = ::LCMapStringA(this->m_locale, LCMAP_LOWERCASE, char_map, 1 << CHAR_BIT, this->m_lower_map, 1 << CHAR_BIT);
+ int r = boost::BOOST_REGEX_DETAIL_NS::LCMapStringA(this->m_locale, lcmap_lowercase, char_map, 1 << CHAR_BIT, this->m_lower_map, 1 << CHAR_BIT);
BOOST_REGEX_ASSERT(r != 0);
#else
- UINT code_page = get_code_page_for_locale_id(this->m_locale);
+ unsigned int code_page = get_code_page_for_locale_id(this->m_locale);
BOOST_REGEX_ASSERT(code_page != 0);
- WCHAR wide_char_map[1 << CHAR_BIT];
- int conv_r = ::MultiByteToWideChar(code_page, 0, char_map, 1 << CHAR_BIT, wide_char_map, 1 << CHAR_BIT);
+ wchar_t wide_char_map[1 << CHAR_BIT];
+ int conv_r = boost::BOOST_REGEX_DETAIL_NS::MultiByteToWideChar(code_page, 0, char_map, 1 << CHAR_BIT, wide_char_map, 1 << CHAR_BIT);
BOOST_REGEX_ASSERT(conv_r != 0);
- WCHAR wide_lower_map[1 << CHAR_BIT];
- int r = ::LCMapStringW(this->m_locale, LCMAP_LOWERCASE, wide_char_map, 1 << CHAR_BIT, wide_lower_map, 1 << CHAR_BIT);
+ wchar_t wide_lower_map[1 << CHAR_BIT];
+ int r = boost::BOOST_REGEX_DETAIL_NS::LCMapStringW(this->m_locale, lcmap_lowercase, wide_char_map, 1 << CHAR_BIT, wide_lower_map, 1 << CHAR_BIT);
BOOST_REGEX_ASSERT(r != 0);
- conv_r = ::WideCharToMultiByte(code_page, 0, wide_lower_map, r, this->m_lower_map, 1 << CHAR_BIT, NULL, NULL);
+ conv_r = boost::BOOST_REGEX_DETAIL_NS::WideCharToMultiByte(code_page, 0, wide_lower_map, r, this->m_lower_map, 1 << CHAR_BIT, NULL, NULL);
BOOST_REGEX_ASSERT(conv_r != 0);
#endif
if (r < (1 << CHAR_BIT))
@@ -781,36 +917,36 @@ namespace BOOST_REGEX_DETAIL_NS {
}
#ifndef BOOST_NO_ANSI_APIS
- r = ::GetStringTypeExA(this->m_locale, CT_CTYPE1, char_map, 1 << CHAR_BIT, this->m_type_map);
+ r = boost::BOOST_REGEX_DETAIL_NS::GetStringTypeExA(this->m_locale, ct_ctype1, char_map, 1 << CHAR_BIT, this->m_type_map);
#else
- r = ::GetStringTypeExW(this->m_locale, CT_CTYPE1, wide_char_map, 1 << CHAR_BIT, this->m_type_map);
+ r = boost::BOOST_REGEX_DETAIL_NS::GetStringTypeExW(this->m_locale, ct_ctype1, wide_char_map, 1 << CHAR_BIT, this->m_type_map);
#endif
BOOST_REGEX_ASSERT(0 != r);
}
inline lcid_type w32_get_default_locale()
{
- return ::GetUserDefaultLCID();
+ return boost::BOOST_REGEX_DETAIL_NS::GetUserDefaultLCID();
}
inline bool w32_is_lower(char c, lcid_type idx)
{
#ifndef BOOST_NO_ANSI_APIS
- WORD mask;
- if (::GetStringTypeExA(idx, CT_CTYPE1, &c, 1, &mask) && (mask & C1_LOWER))
+ word mask;
+ if (boost::BOOST_REGEX_DETAIL_NS::GetStringTypeExA(idx, ct_ctype1, &c, 1, &mask) && (mask & c1_lower))
return true;
return false;
#else
- UINT code_page = get_code_page_for_locale_id(idx);
+ unsigned int code_page = get_code_page_for_locale_id(idx);
if (code_page == 0)
return false;
- WCHAR wide_c;
- if (::MultiByteToWideChar(code_page, 0, &c, 1, &wide_c, 1) == 0)
+ wchar_t wide_c;
+ if (boost::BOOST_REGEX_DETAIL_NS::MultiByteToWideChar(code_page, 0, &c, 1, &wide_c, 1) == 0)
return false;
- WORD mask;
- if (::GetStringTypeExW(idx, CT_CTYPE1, &wide_c, 1, &mask) && (mask & C1_LOWER))
+ word mask;
+ if (boost::BOOST_REGEX_DETAIL_NS::GetStringTypeExW(idx, ct_ctype1, &wide_c, 1, &mask) && (mask & c1_lower))
return true;
return false;
#endif
@@ -818,8 +954,8 @@ namespace BOOST_REGEX_DETAIL_NS {
inline bool w32_is_lower(wchar_t c, lcid_type idx)
{
- WORD mask;
- if (::GetStringTypeExW(idx, CT_CTYPE1, &c, 1, &mask) && (mask & C1_LOWER))
+ word mask;
+ if (boost::BOOST_REGEX_DETAIL_NS::GetStringTypeExW(idx, ct_ctype1, &c, 1, &mask) && (mask & c1_lower))
return true;
return false;
}
@@ -827,21 +963,21 @@ namespace BOOST_REGEX_DETAIL_NS {
inline bool w32_is_upper(char c, lcid_type idx)
{
#ifndef BOOST_NO_ANSI_APIS
- WORD mask;
- if (::GetStringTypeExA(idx, CT_CTYPE1, &c, 1, &mask) && (mask & C1_UPPER))
+ word mask;
+ if (boost::BOOST_REGEX_DETAIL_NS::GetStringTypeExA(idx, ct_ctype1, &c, 1, &mask) && (mask & c1_upper))
return true;
return false;
#else
- UINT code_page = get_code_page_for_locale_id(idx);
+ unsigned int code_page = get_code_page_for_locale_id(idx);
if (code_page == 0)
return false;
- WCHAR wide_c;
- if (::MultiByteToWideChar(code_page, 0, &c, 1, &wide_c, 1) == 0)
+ wchar_t wide_c;
+ if (boost::BOOST_REGEX_DETAIL_NS::MultiByteToWideChar(code_page, 0, &c, 1, &wide_c, 1) == 0)
return false;
- WORD mask;
- if (::GetStringTypeExW(idx, CT_CTYPE1, &wide_c, 1, &mask) && (mask & C1_UPPER))
+ word mask;
+ if (boost::BOOST_REGEX_DETAIL_NS::GetStringTypeExW(idx, ct_ctype1, &wide_c, 1, &mask) && (mask & c1_upper))
return true;
return false;
#endif
@@ -849,28 +985,28 @@ namespace BOOST_REGEX_DETAIL_NS {
inline bool w32_is_upper(wchar_t c, lcid_type idx)
{
- WORD mask;
- if (::GetStringTypeExW(idx, CT_CTYPE1, &c, 1, &mask) && (mask & C1_UPPER))
+ word mask;
+ if (boost::BOOST_REGEX_DETAIL_NS::GetStringTypeExW(idx, ct_ctype1, &c, 1, &mask) && (mask & c1_upper))
return true;
return false;
}
inline void free_module(void* mod)
{
- ::FreeLibrary(static_cast(mod));
+ boost::BOOST_REGEX_DETAIL_NS::FreeLibrary(static_cast(mod));
}
inline cat_type w32_cat_open(const std::string& name)
{
#ifndef BOOST_NO_ANSI_APIS
- cat_type result(::LoadLibraryA(name.c_str()), &free_module);
+ cat_type result(boost::BOOST_REGEX_DETAIL_NS::LoadLibraryA(name.c_str()), &free_module);
return result;
#else
- LPWSTR wide_name = (LPWSTR)_alloca((name.size() + 1) * sizeof(WCHAR));
- if (::MultiByteToWideChar(CP_ACP, 0, name.c_str(), name.size(), wide_name, name.size() + 1) == 0)
+ wchar_t* wide_name = (wchar_t*)_alloca((name.size() + 1) * sizeof(wchar_t));
+ if (boost::BOOST_REGEX_DETAIL_NS::MultiByteToWideChar(cp_acp, 0, name.c_str(), (int)name.size(), wide_name, (int)(name.size() + 1)) == 0)
return cat_type();
- cat_type result(::LoadLibraryW(wide_name), &free_module);
+ cat_type result(boost::BOOST_REGEX_DETAIL_NS::LoadLibraryW(wide_name), &free_module);
return result;
#endif
}
@@ -879,7 +1015,7 @@ namespace BOOST_REGEX_DETAIL_NS {
{
#ifndef BOOST_NO_ANSI_APIS
char buf[256];
- if (0 == ::LoadStringA(
+ if (0 == boost::BOOST_REGEX_DETAIL_NS::LoadStringA(
static_cast(cat.get()),
i,
buf,
@@ -889,8 +1025,8 @@ namespace BOOST_REGEX_DETAIL_NS {
return def;
}
#else
- WCHAR wbuf[256];
- int r = ::LoadStringW(
+ wchar_t wbuf[256];
+ int r = boost::BOOST_REGEX_DETAIL_NS::LoadStringW(
static_cast(cat.get()),
i,
wbuf,
@@ -900,9 +1036,9 @@ namespace BOOST_REGEX_DETAIL_NS {
return def;
- int buf_size = 1 + ::WideCharToMultiByte(CP_ACP, 0, wbuf, r, NULL, 0, NULL, NULL);
- LPSTR buf = (LPSTR)_alloca(buf_size);
- if (::WideCharToMultiByte(CP_ACP, 0, wbuf, r, buf, buf_size, NULL, NULL) == 0)
+ int buf_size = 1 + boost::BOOST_REGEX_DETAIL_NS::WideCharToMultiByte(cp_acp, 0, wbuf, r, NULL, 0, NULL, NULL);
+ char* buf = (char*)_alloca(buf_size);
+ if (boost::BOOST_REGEX_DETAIL_NS::WideCharToMultiByte(cp_acp, 0, wbuf, r, buf, buf_size, NULL, NULL) == 0)
return def; // failed conversion.
#endif
return std::string(buf);
@@ -912,12 +1048,7 @@ namespace BOOST_REGEX_DETAIL_NS {
inline std::wstring w32_cat_get(const cat_type& cat, lcid_type, int i, const std::wstring& def)
{
wchar_t buf[256];
- if (0 == ::LoadStringW(
- static_cast(cat.get()),
- i,
- buf,
- 256
- ))
+ if (0 == boost::BOOST_REGEX_DETAIL_NS::LoadStringW(static_cast(cat.get()), i, buf, 256))
{
return def;
}
@@ -927,9 +1058,9 @@ namespace BOOST_REGEX_DETAIL_NS {
inline std::string w32_transform(lcid_type idx, const char* p1, const char* p2)
{
#ifndef BOOST_NO_ANSI_APIS
- int bytes = ::LCMapStringA(
+ int bytes = boost::BOOST_REGEX_DETAIL_NS::LCMapStringA(
idx, // locale identifier
- LCMAP_SORTKEY, // mapping transformation type
+ lcmap_sortkey, // mapping transformation type
p1, // source string
static_cast(p2 - p1), // number of characters in source string
0, // destination buffer
@@ -938,27 +1069,27 @@ namespace BOOST_REGEX_DETAIL_NS {
if (!bytes)
return std::string(p1, p2);
std::string result(++bytes, '\0');
- bytes = ::LCMapStringA(
+ bytes = boost::BOOST_REGEX_DETAIL_NS::LCMapStringA(
idx, // locale identifier
- LCMAP_SORTKEY, // mapping transformation type
+ lcmap_sortkey, // mapping transformation type
p1, // source string
static_cast(p2 - p1), // number of characters in source string
&*result.begin(), // destination buffer
bytes // size of destination buffer
);
#else
- UINT code_page = get_code_page_for_locale_id(idx);
+ unsigned int code_page = get_code_page_for_locale_id(idx);
if (code_page == 0)
return std::string(p1, p2);
int src_len = static_cast(p2 - p1);
- LPWSTR wide_p1 = (LPWSTR)_alloca((src_len + 1) * 2);
- if (::MultiByteToWideChar(code_page, 0, p1, src_len, wide_p1, src_len + 1) == 0)
+ wchar_t* wide_p1 = (wchar_t*)_alloca((src_len + 1) * 2);
+ if (boost::BOOST_REGEX_DETAIL_NS::MultiByteToWideChar(code_page, 0, p1, src_len, wide_p1, src_len + 1) == 0)
return std::string(p1, p2);
- int bytes = ::LCMapStringW(
+ int bytes = boost::BOOST_REGEX_DETAIL_NS::LCMapStringW(
idx, // locale identifier
- LCMAP_SORTKEY, // mapping transformation type
+ lcmap_sortkey, // mapping transformation type
wide_p1, // source string
src_len, // number of characters in source string
0, // destination buffer
@@ -967,12 +1098,12 @@ namespace BOOST_REGEX_DETAIL_NS {
if (!bytes)
return std::string(p1, p2);
std::string result(++bytes, '\0');
- bytes = ::LCMapStringW(
+ bytes = boost::BOOST_REGEX_DETAIL_NS::LCMapStringW(
idx, // locale identifier
- LCMAP_SORTKEY, // mapping transformation type
+ lcmap_sortkey, // mapping transformation type
wide_p1, // source string
src_len, // number of characters in source string
- (LPWSTR) & *result.begin(), // destination buffer
+ (wchar_t*) & *result.begin(), // destination buffer
bytes // size of destination buffer
);
#endif
@@ -988,9 +1119,9 @@ namespace BOOST_REGEX_DETAIL_NS {
#ifndef BOOST_NO_WREGEX
inline std::wstring w32_transform(lcid_type idx, const wchar_t* p1, const wchar_t* p2)
{
- int bytes = ::LCMapStringW(
+ int bytes = boost::BOOST_REGEX_DETAIL_NS::LCMapStringW(
idx, // locale identifier
- LCMAP_SORTKEY, // mapping transformation type
+ lcmap_sortkey, // mapping transformation type
p1, // source string
static_cast(p2 - p1), // number of characters in source string
0, // destination buffer
@@ -999,9 +1130,9 @@ namespace BOOST_REGEX_DETAIL_NS {
if (!bytes)
return std::wstring(p1, p2);
std::string result(++bytes, '\0');
- bytes = ::LCMapStringW(
+ bytes = boost::BOOST_REGEX_DETAIL_NS::LCMapStringW(
idx, // locale identifier
- LCMAP_SORTKEY, // mapping transformation type
+ lcmap_sortkey, // mapping transformation type
p1, // source string
static_cast(p2 - p1), // number of characters in source string
reinterpret_cast(&*result.begin()), // destination buffer *of bytes*
@@ -1023,9 +1154,9 @@ namespace BOOST_REGEX_DETAIL_NS {
{
char result[2];
#ifndef BOOST_NO_ANSI_APIS
- int b = ::LCMapStringA(
+ int b = boost::BOOST_REGEX_DETAIL_NS::LCMapStringA(
idx, // locale identifier
- LCMAP_LOWERCASE, // mapping transformation type
+ lcmap_lowercase, // mapping transformation type
&c, // source string
1, // number of characters in source string
result, // destination buffer
@@ -1033,18 +1164,18 @@ namespace BOOST_REGEX_DETAIL_NS {
if (b == 0)
return c;
#else
- UINT code_page = get_code_page_for_locale_id(idx);
+ unsigned int code_page = get_code_page_for_locale_id(idx);
if (code_page == 0)
return c;
- WCHAR wide_c;
- if (::MultiByteToWideChar(code_page, 0, &c, 1, &wide_c, 1) == 0)
+ wchar_t wide_c;
+ if (boost::BOOST_REGEX_DETAIL_NS::MultiByteToWideChar(code_page, 0, &c, 1, &wide_c, 1) == 0)
return c;
- WCHAR wide_result;
- int b = ::LCMapStringW(
+ wchar_t wide_result;
+ int b = boost::BOOST_REGEX_DETAIL_NS::LCMapStringW(
idx, // locale identifier
- LCMAP_LOWERCASE, // mapping transformation type
+ lcmap_lowercase, // mapping transformation type
&wide_c, // source string
1, // number of characters in source string
&wide_result, // destination buffer
@@ -1052,7 +1183,7 @@ namespace BOOST_REGEX_DETAIL_NS {
if (b == 0)
return c;
- if (::WideCharToMultiByte(code_page, 0, &wide_result, 1, result, 2, NULL, NULL) == 0)
+ if (boost::BOOST_REGEX_DETAIL_NS::WideCharToMultiByte(code_page, 0, &wide_result, 1, result, 2, NULL, NULL) == 0)
return c; // No single byte lower case equivalent available
#endif
return result[0];
@@ -1062,9 +1193,9 @@ namespace BOOST_REGEX_DETAIL_NS {
inline wchar_t w32_tolower(wchar_t c, lcid_type idx)
{
wchar_t result[2];
- int b = ::LCMapStringW(
+ int b = boost::BOOST_REGEX_DETAIL_NS::LCMapStringW(
idx, // locale identifier
- LCMAP_LOWERCASE, // mapping transformation type
+ lcmap_lowercase, // mapping transformation type
&c, // source string
1, // number of characters in source string
result, // destination buffer
@@ -1078,9 +1209,9 @@ namespace BOOST_REGEX_DETAIL_NS {
{
char result[2];
#ifndef BOOST_NO_ANSI_APIS
- int b = ::LCMapStringA(
+ int b = boost::BOOST_REGEX_DETAIL_NS::LCMapStringA(
idx, // locale identifier
- LCMAP_UPPERCASE, // mapping transformation type
+ lcmap_uppercase, // mapping transformation type
&c, // source string
1, // number of characters in source string
result, // destination buffer
@@ -1088,18 +1219,18 @@ namespace BOOST_REGEX_DETAIL_NS {
if (b == 0)
return c;
#else
- UINT code_page = get_code_page_for_locale_id(idx);
+ unsigned int code_page = get_code_page_for_locale_id(idx);
if (code_page == 0)
return c;
- WCHAR wide_c;
- if (::MultiByteToWideChar(code_page, 0, &c, 1, &wide_c, 1) == 0)
+ wchar_t wide_c;
+ if (boost::BOOST_REGEX_DETAIL_NS::MultiByteToWideChar(code_page, 0, &c, 1, &wide_c, 1) == 0)
return c;
- WCHAR wide_result;
- int b = ::LCMapStringW(
+ wchar_t wide_result;
+ int b = boost::BOOST_REGEX_DETAIL_NS::LCMapStringW(
idx, // locale identifier
- LCMAP_UPPERCASE, // mapping transformation type
+ lcmap_uppercase, // mapping transformation type
&wide_c, // source string
1, // number of characters in source string
&wide_result, // destination buffer
@@ -1107,7 +1238,7 @@ namespace BOOST_REGEX_DETAIL_NS {
if (b == 0)
return c;
- if (::WideCharToMultiByte(code_page, 0, &wide_result, 1, result, 2, NULL, NULL) == 0)
+ if (boost::BOOST_REGEX_DETAIL_NS::WideCharToMultiByte(code_page, 0, &wide_result, 1, result, 2, NULL, NULL) == 0)
return c; // No single byte upper case equivalent available.
#endif
return result[0];
@@ -1117,9 +1248,9 @@ namespace BOOST_REGEX_DETAIL_NS {
inline wchar_t w32_toupper(wchar_t c, lcid_type idx)
{
wchar_t result[2];
- int b = ::LCMapStringW(
+ int b = boost::BOOST_REGEX_DETAIL_NS::LCMapStringW(
idx, // locale identifier
- LCMAP_UPPERCASE, // mapping transformation type
+ lcmap_uppercase, // mapping transformation type
&c, // source string
1, // number of characters in source string
result, // destination buffer
@@ -1131,20 +1262,20 @@ namespace BOOST_REGEX_DETAIL_NS {
#endif
inline bool w32_is(lcid_type idx, std::uint32_t m, char c)
{
- WORD mask;
+ word mask;
#ifndef BOOST_NO_ANSI_APIS
- if (::GetStringTypeExA(idx, CT_CTYPE1, &c, 1, &mask) && (mask & m & w32_regex_traits_implementation::mask_base))
+ if (boost::BOOST_REGEX_DETAIL_NS::GetStringTypeExA(idx, ct_ctype1, &c, 1, &mask) && (mask & m & w32_regex_traits_implementation::mask_base))
return true;
#else
- UINT code_page = get_code_page_for_locale_id(idx);
+ unsigned int code_page = get_code_page_for_locale_id(idx);
if (code_page == 0)
return false;
- WCHAR wide_c;
- if (::MultiByteToWideChar(code_page, 0, &c, 1, &wide_c, 1) == 0)
+ wchar_t wide_c;
+ if (boost::BOOST_REGEX_DETAIL_NS::MultiByteToWideChar(code_page, 0, &c, 1, &wide_c, 1) == 0)
return false;
- if (::GetStringTypeExW(idx, CT_CTYPE1, &wide_c, 1, &mask) && (mask & m & w32_regex_traits_implementation::mask_base))
+ if (boost::BOOST_REGEX_DETAIL_NS::GetStringTypeExW(idx, ct_ctype1, &wide_c, 1, &mask) && (mask & m & w32_regex_traits_implementation::mask_base))
return true;
#endif
if ((m & w32_regex_traits_implementation::mask_word) && (c == '_'))
@@ -1155,8 +1286,8 @@ namespace BOOST_REGEX_DETAIL_NS {
#ifndef BOOST_NO_WREGEX
inline bool w32_is(lcid_type idx, std::uint32_t m, wchar_t c)
{
- WORD mask;
- if (::GetStringTypeExW(idx, CT_CTYPE1, &c, 1, &mask) && (mask & m & w32_regex_traits_implementation::mask_base))
+ word mask;
+ if (boost::BOOST_REGEX_DETAIL_NS::GetStringTypeExW(idx, ct_ctype1, &c, 1, &mask) && (mask & m & w32_regex_traits_implementation::mask_base))
return true;
if ((m & w32_regex_traits_implementation::mask_word) && (c == '_'))
return true;
From 6050fa4fd4fdd1abc2c0b2841387d37adab767e6 Mon Sep 17 00:00:00 2001
From: jzmaddock
Date: Wed, 6 Oct 2021 08:41:00 +0100
Subject: [PATCH 05/20] Add some more windows checks, remove outdated CI tests
(Xenial is no longer supported).
---
.github/workflows/ci.yml | 51 ------------------------------------
test/Jamfile.v2 | 5 ++++
test/test_windows_defs_1.cpp | 29 ++++++++++++++++++++
test/test_windows_defs_2.cpp | 29 ++++++++++++++++++++
test/test_windows_defs_3.cpp | 27 +++++++++++++++++++
test/test_windows_defs_4.cpp | 28 ++++++++++++++++++++
6 files changed, 118 insertions(+), 51 deletions(-)
create mode 100644 test/test_windows_defs_1.cpp
create mode 100644 test/test_windows_defs_2.cpp
create mode 100644 test/test_windows_defs_3.cpp
create mode 100644 test/test_windows_defs_4.cpp
diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml
index 8c104347..ce5e3275 100644
--- a/.github/workflows/ci.yml
+++ b/.github/workflows/ci.yml
@@ -108,57 +108,6 @@ jobs:
- name: Test
run: ../../../b2 toolset=$TOOLSET define=CI_SUPPRESS_KNOWN_ISSUES define=SLOW_COMPILER
working-directory: ../boost-root/libs/regex/test
- ubuntu-xenial:
- runs-on: ubuntu-16.04
- strategy:
- fail-fast: false
- matrix:
- compiler: [ g++-5, g++-6, clang++-5.0, clang++-6.0 ]
- standard: [ c++03 c++11, c++14, c++1z ]
- 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++-5 g++-6 clang-5.0 clang-6.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: Generate headers
- run: ./b2 headers
- working-directory: ../boost-root
- - name: Generate user config
- run: 'echo "using $TOOLSET : : ${{ matrix.compiler }} : -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
macos:
runs-on: macos-latest
strategy:
diff --git a/test/Jamfile.v2 b/test/Jamfile.v2
index 9a50918c..04514302 100644
--- a/test/Jamfile.v2
+++ b/test/Jamfile.v2
@@ -224,3 +224,8 @@ compile test_warnings.cpp
BOOST_REGEX_STANDALONE
[ check-target-builds ../build//is_legacy_03 : : no ]
: test_warnings_standalone ;
+
+compile test_windows_defs_1.cpp ;
+compile test_windows_defs_2.cpp ;
+compile test_windows_defs_3.cpp ;
+compile test_windows_defs_4.cpp ;
diff --git a/test/test_windows_defs_1.cpp b/test/test_windows_defs_1.cpp
new file mode 100644
index 00000000..5415a607
--- /dev/null
+++ b/test/test_windows_defs_1.cpp
@@ -0,0 +1,29 @@
+/*
+*
+* Copyright (c) 2021
+* 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)
+*
+*/
+
+#if defined(_WIN32) && !defined(BOOST_REGEX_NO_W32)
+//
+// Make sure our forward declarations match those in windows.h:
+//
+
+#define STRICT
+
+#include
+#include
+
+void test_proc()
+{
+ std::string text, re;
+ boost::regex exp(re);
+ regex_match(text, exp);
+}
+
+#endif
diff --git a/test/test_windows_defs_2.cpp b/test/test_windows_defs_2.cpp
new file mode 100644
index 00000000..8707b36b
--- /dev/null
+++ b/test/test_windows_defs_2.cpp
@@ -0,0 +1,29 @@
+/*
+*
+* Copyright (c) 2021
+* 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)
+*
+*/
+
+#if defined(_WIN32) && !defined(BOOST_REGEX_NO_W32)
+//
+// Make sure our forward declarations match those in windows.h:
+//
+
+#define NO_STRICT
+
+#include
+#include
+
+void test_proc()
+{
+ std::string text, re;
+ boost::regex exp(re);
+ regex_match(text, exp);
+}
+
+#endif
diff --git a/test/test_windows_defs_3.cpp b/test/test_windows_defs_3.cpp
new file mode 100644
index 00000000..bc369d34
--- /dev/null
+++ b/test/test_windows_defs_3.cpp
@@ -0,0 +1,27 @@
+/*
+*
+* Copyright (c) 2021
+* 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)
+*
+*/
+
+#if defined(_WIN32) && !defined(BOOST_REGEX_NO_W32)
+//
+// Make sure our forward declarations match those in windows.h:
+//
+
+#include
+#include
+
+void test_proc()
+{
+ std::string text, re;
+ boost::regex exp(re);
+ regex_match(text, exp);
+}
+
+#endif
diff --git a/test/test_windows_defs_4.cpp b/test/test_windows_defs_4.cpp
new file mode 100644
index 00000000..09a0015c
--- /dev/null
+++ b/test/test_windows_defs_4.cpp
@@ -0,0 +1,28 @@
+/*
+*
+* Copyright (c) 2021
+* 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)
+*
+*/
+
+#if defined(_WIN32) && !defined(BOOST_REGEX_NO_W32)
+//
+// Make sure our forward declarations match those in windows.h:
+//
+#define STRICT
+#define BOOST_NO_ANSI_APIS
+#include
+#include
+
+void test_proc()
+{
+ std::string text, re;
+ boost::regex exp(re);
+ regex_match(text, exp);
+}
+
+#endif
From 10cff29314fe1a31ba1c87ea651813be5b828356 Mon Sep 17 00:00:00 2001
From: jzmaddock
Date: Thu, 7 Oct 2021 18:52:27 +0100
Subject: [PATCH 06/20] Change \B to be the opposite of \b. Also update docs.
Fixes https://github.com/boostorg/regex/issues/123.
---
doc/history.qbk | 10 ++++++++++
doc/regex.qbk | 2 +-
include/boost/regex/v5/perl_matcher_common.hpp | 6 ++++++
test/regress/test_escapes.cpp | 1 +
4 files changed, 18 insertions(+), 1 deletion(-)
diff --git a/doc/history.qbk b/doc/history.qbk
index be64bb13..c1381818 100644
--- a/doc/history.qbk
+++ b/doc/history.qbk
@@ -14,6 +14,16 @@ Currently open issues can be viewed [@https://github.com/boostorg/regex/issues?q
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.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.
+
+[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].
diff --git a/doc/regex.qbk b/doc/regex.qbk
index c13e5587..49cc7f89 100644
--- a/doc/regex.qbk
+++ b/doc/regex.qbk
@@ -8,7 +8,7 @@
[@http://www.boost.org/LICENSE_1_0.txt])
]
[authors [Maddock, John]]
- [version 5.1.4]
+ [version 7.0.0]
[/last-revision $Date$]
]
diff --git a/include/boost/regex/v5/perl_matcher_common.hpp b/include/boost/regex/v5/perl_matcher_common.hpp
index 5b29d893..dcce9e6a 100644
--- a/include/boost/regex/v5/perl_matcher_common.hpp
+++ b/include/boost/regex/v5/perl_matcher_common.hpp
@@ -471,6 +471,11 @@ bool perl_matcher::match_word_boundary()
template
bool perl_matcher::match_within_word()
{
+ bool b = !match_word_boundary();
+ if(b)
+ pstate = pstate->next.p;
+ return b;
+ /*
if(position == last)
return false;
// both prev and this character must be m_word_mask:
@@ -492,6 +497,7 @@ bool perl_matcher::match_within_word()
}
}
return false;
+ */
}
template
diff --git a/test/regress/test_escapes.cpp b/test/regress/test_escapes.cpp
index 74212677..a8a2b859 100644
--- a/test/regress/test_escapes.cpp
+++ b/test/regress/test_escapes.cpp
@@ -112,6 +112,7 @@ void test_assertion_escapes()
TEST_REGEX_SEARCH("\\By\\b", perl, "xy", match_default, make_array(1, 2, -2, -2));
TEST_REGEX_SEARCH("\\by\\B", perl, "yz", match_default, make_array(0, 1, -2, -2));
TEST_REGEX_SEARCH("\\B\\*\\B", perl, " * ", match_default, make_array(1, 2, -2, -2));
+ TEST_REGEX_SEARCH(".\\B.", perl, "!?", match_default, make_array(0, 2, -2, -2));
// buffer operators:
TEST_REGEX_SEARCH("\\`abc", perl, "abc", match_default, make_array(0, 3, -2, -2));
TEST_REGEX_SEARCH("\\`abc", perl, "\nabc", match_default, make_array(-2, -2));
From 74347b95af2d2d970a67649bdf3d344587da4565 Mon Sep 17 00:00:00 2001
From: jzmaddock
Date: Fri, 8 Oct 2021 14:51:01 +0100
Subject: [PATCH 07/20] Allow back references to refer to a capture that hasn't
happened yet ("forward reference"). Fixes
https://github.com/boostorg/regex/issues/133.
---
doc/syntax_perl.qbk | 6 ++-
.../boost/regex/v5/basic_regex_creator.hpp | 1 -
include/boost/regex/v5/basic_regex_parser.hpp | 27 +++++-----
include/boost/regex/v5/indexed_bit_flag.hpp | 54 -------------------
test/regress/test_backrefs.cpp | 14 +++--
5 files changed, 29 insertions(+), 73 deletions(-)
delete mode 100644 include/boost/regex/v5/indexed_bit_flag.hpp
diff --git a/doc/syntax_perl.qbk b/doc/syntax_perl.qbk
index 233db3cf..6d062f46 100644
--- a/doc/syntax_perl.qbk
+++ b/doc/syntax_perl.qbk
@@ -195,7 +195,11 @@ You can also use the \g escape for the same function, for example:
[[[^\g{one}]][Match whatever matched the sub-expression named "one"]]
]
-Finally the \k escape can be used to refer to named subexpressions, for example [^\k] will match
+Note that a back reference can also be a forward-reference to a sub-expression that has not yet
+been seen - this only really makes sense within a repeat, so for example `(\2two|(one))+` will
+match "oneonetwo".
+
+Finally the \k escape can be used to refer to named subexpressions, for example [^\k] will
whatever matched the subexpression named "two".
[h4 Alternation]
diff --git a/include/boost/regex/v5/basic_regex_creator.hpp b/include/boost/regex/v5/basic_regex_creator.hpp
index ddd2f257..1dc7f046 100644
--- a/include/boost/regex/v5/basic_regex_creator.hpp
+++ b/include/boost/regex/v5/basic_regex_creator.hpp
@@ -232,7 +232,6 @@ protected:
bool m_icase; // true for case insensitive matches
unsigned m_repeater_id; // the state_id of the next repeater
bool m_has_backrefs; // true if there are actually any backrefs
- indexed_bit_flag m_backrefs; // bitmask of permitted backrefs
std::uintmax_t m_bad_repeats; // bitmask of repeats we can't deduce a startmap for;
bool m_has_recursions; // set when we have recursive expressions to fixup
std::vector m_recursion_checks; // notes which recursions we've followed while analysing this expression
diff --git a/include/boost/regex/v5/basic_regex_parser.hpp b/include/boost/regex/v5/basic_regex_parser.hpp
index 11d581d9..ec9279c0 100644
--- a/include/boost/regex/v5/basic_regex_parser.hpp
+++ b/include/boost/regex/v5/basic_regex_parser.hpp
@@ -98,6 +98,7 @@ private:
std::ptrdiff_t m_alt_insert_point; // where to insert the next alternative
bool m_has_case_change; // true if somewhere in the current block the case has changed
unsigned m_recursion_count; // How many times we've called parse_all.
+ unsigned m_max_backref; // Largest index of any backref.
#if defined(BOOST_REGEX_MSVC) && defined(_M_IX86)
// This is an ugly warning suppression workaround (for warnings *inside* std::vector
// that can not otherwise be suppressed)...
@@ -114,7 +115,7 @@ private:
template
basic_regex_parser::basic_regex_parser(regex_data* data)
: basic_regex_creator(data), m_parser_proc(), m_base(0), m_end(0), m_position(0),
- m_mark_count(0), m_mark_reset(-1), m_max_mark(0), m_paren_start(0), m_alt_insert_point(0), m_has_case_change(false), m_recursion_count(0)
+ m_mark_count(0), m_mark_reset(-1), m_max_mark(0), m_paren_start(0), m_alt_insert_point(0), m_has_case_change(false), m_recursion_count(0), m_max_backref(0)
{
}
@@ -184,6 +185,13 @@ void basic_regex_parser::parse(const charT* p1, const charT* p2,
return;
// fill in our sub-expression count:
this->m_pdata->m_mark_count = 1u + (std::size_t)m_mark_count;
+ //
+ // Check we don't have backreferences to sub-expressions which don't exist:
+ //
+ if (m_max_backref > m_mark_count)
+ {
+ fail(regex_constants::error_backref, std::distance(m_base, m_position), "Found a backreference to a non-existant sub-expression.");
+ }
this->finalize(p1, p2);
}
@@ -529,11 +537,6 @@ bool basic_regex_parser::parse_open_paren()
// restore the alternate insertion point:
//
this->m_alt_insert_point = last_alt_point;
- //
- // allow backrefs to this mark:
- //
- if(markid > 0)
- this->m_backrefs.set(markid);
return true;
}
@@ -899,12 +902,14 @@ escape_type_class_jump:
}
if(negative)
i = 1 + (static_cast(m_mark_count) - i);
- if(((i < hash_value_mask) && (i > 0) && (this->m_backrefs.test((std::size_t)i))) || ((i >= hash_value_mask) && (this->m_pdata->get_id((int)i) > 0) && (this->m_backrefs.test(this->m_pdata->get_id((int)i)))))
+ if(((i < hash_value_mask) && (i > 0)) || ((i >= hash_value_mask) && (this->m_pdata->get_id((int)i) > 0)))
{
m_position = pc;
re_brace* pb = static_cast(this->append_state(syntax_element_backref, sizeof(re_brace)));
pb->index = (int)i;
pb->icase = this->flags() & regbase::icase;
+ if ((i > m_max_backref) && (i < hash_value_mask))
+ m_max_backref = i;
}
else
{
@@ -1934,12 +1939,14 @@ bool basic_regex_parser::parse_backref()
charT c = unescape_character();
this->append_literal(c);
}
- else if((i > 0) && (this->m_backrefs.test((std::size_t)i)))
+ else if((i > 0))
{
m_position = pc;
re_brace* pb = static_cast(this->append_state(syntax_element_backref, sizeof(re_brace)));
pb->index = (int)i;
pb->icase = this->flags() & regbase::icase;
+ if(i > m_max_backref)
+ m_max_backref = i;
}
else
{
@@ -2695,10 +2702,6 @@ option_group_jump:
{
if(this->flags() & regbase::save_subexpression_location)
this->m_pdata->m_subs.at((std::size_t)markid - 1).second = std::distance(m_base, m_position) - 1;
- //
- // allow backrefs to this mark:
- //
- this->m_backrefs.set(markid);
}
return true;
}
diff --git a/include/boost/regex/v5/indexed_bit_flag.hpp b/include/boost/regex/v5/indexed_bit_flag.hpp
deleted file mode 100644
index b61e5cad..00000000
--- a/include/boost/regex/v5/indexed_bit_flag.hpp
+++ /dev/null
@@ -1,54 +0,0 @@
-/*
- *
- * 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)
- *
- */
-
- /*
- * LOCATION: see http://www.boost.org for most recent version.
- * FILE basic_regex_parser.cpp
- * VERSION see
- * DESCRIPTION: Declares template class basic_regex_parser.
- */
-
-#include
-#include
-
-#ifndef BOOST_REGEX_V5_INDEXED_BIT_FLAG_HPP
-#define BOOST_REGEX_V5_INDEXED_BIT_FLAG_HPP
-
-namespace boost{
-namespace BOOST_REGEX_DETAIL_NS{
-
-class indexed_bit_flag
-{
- std::uint64_t low_mask;
- std::set mask_set;
-public:
- indexed_bit_flag() : low_mask(0) {}
- void set(std::size_t i)
- {
- if (i < std::numeric_limits::digits - 1)
- low_mask |= static_cast(1u) << i;
- else
- mask_set.insert(i);
- }
- bool test(std::size_t i)
- {
- if (i < std::numeric_limits::digits - 1)
- return low_mask & static_cast(1u) << i ? true : false;
- else
- return mask_set.find(i) != mask_set.end();
- }
-};
-
-} // namespace BOOST_REGEX_DETAIL_NS
-} // namespace boost
-
-
-#endif
diff --git a/test/regress/test_backrefs.cpp b/test/regress/test_backrefs.cpp
index be9f54ca..20a77838 100644
--- a/test/regress/test_backrefs.cpp
+++ b/test/regress/test_backrefs.cpp
@@ -19,13 +19,15 @@ void test_backrefs()
{
using namespace boost::regex_constants;
TEST_INVALID_REGEX("a(b)\\2c", perl);
- TEST_INVALID_REGEX("a(b\\1)c", perl);
+ //TEST_INVALID_REGEX("a(b\\1)c", perl);
TEST_REGEX_SEARCH("a(b*)c\\1d", perl, "abbcbbd", match_default, make_array(0, 7, 1, 3, -2, -2));
TEST_REGEX_SEARCH("a(b*)c\\1d", perl, "abbcbd", match_default, make_array(-2, -2));
TEST_REGEX_SEARCH("a(b*)c\\1d", perl, "abbcbbbd", match_default, make_array(-2, -2));
TEST_REGEX_SEARCH("^(.)\\1", perl, "abc", match_default, make_array(-2, -2));
TEST_REGEX_SEARCH("a([bc])\\1d", perl, "abcdabbd", match_default, make_array(4, 8, 5, 6, -2, -2));
TEST_REGEX_SEARCH("a\\([bc]\\)\\1d", basic, "abcdabbd", match_default, make_array(4, 8, 5, 6, -2, -2));
+ TEST_REGEX_SEARCH("(\\2two|(one))+", perl, "oneonetwo", match_default, make_array(0, 9, 3, 9, 0, 3, -2, -2));
+ TEST_INVALID_REGEX("(\\3two|(one))+", perl);
// strictly speaking this is at best ambiguous, at worst wrong, this is what most
// re implimentations will match though.
TEST_REGEX_SEARCH("a(([bc])\\2)*d", perl, "abbccd", match_default, make_array(0, 6, 3, 5, 3, 4, -2, -2));
@@ -59,7 +61,7 @@ void test_backrefs()
// Now test the \g version:
//
TEST_INVALID_REGEX("a(b)\\g2c", perl);
- TEST_INVALID_REGEX("a(b\\g1)c", perl);
+ //TEST_INVALID_REGEX("a(b\\g1)c", perl);
TEST_INVALID_REGEX("a(b\\g0)c", perl);
TEST_REGEX_SEARCH("a(b*)c\\g1d", perl, "abbcbbd", match_default, make_array(0, 7, 1, 3, -2, -2));
TEST_REGEX_SEARCH("a(b*)c\\g1d", perl, "abbcbd", match_default, make_array(-2, -2));
@@ -67,8 +69,10 @@ void test_backrefs()
TEST_REGEX_SEARCH("^(.)\\g1", perl, "abc", match_default, make_array(-2, -2));
TEST_REGEX_SEARCH("a([bc])\\g1d", perl, "abcdabbd", match_default, make_array(4, 8, 5, 6, -2, -2));
TEST_INVALID_REGEX("a(b)\\g{2}c", perl);
- TEST_INVALID_REGEX("a(b\\g{1})c", perl);
+ //TEST_INVALID_REGEX("a(b\\g{1})c", perl);
TEST_INVALID_REGEX("a(b\\g{0})c", perl);
+ TEST_REGEX_SEARCH("(\\g{2}two|(one))+", perl, "oneonetwo", match_default, make_array(0, 9, 3, 9, 0, 3, -2, -2));
+ TEST_INVALID_REGEX("(\\g{3}two|(one))+", perl);
TEST_REGEX_SEARCH("a(b*)c\\g{1}d", perl, "abbcbbd", match_default, make_array(0, 7, 1, 3, -2, -2));
TEST_REGEX_SEARCH("a(b*)c\\g{1}d", perl, "abbcbd", match_default, make_array(-2, -2));
TEST_REGEX_SEARCH("a(b*)c\\g{1}d", perl, "abbcbbbd", match_default, make_array(-2, -2));
@@ -76,7 +80,7 @@ void test_backrefs()
TEST_REGEX_SEARCH("a([bc])\\g{1}d", perl, "abcdabbd", match_default, make_array(4, 8, 5, 6, -2, -2));
// And again but with negative indexes:
TEST_INVALID_REGEX("a(b)\\g-2c", perl);
- TEST_INVALID_REGEX("a(b\\g-1)c", perl);
+ //TEST_INVALID_REGEX("a(b\\g-1)c", perl);
TEST_INVALID_REGEX("a(b\\g-0)c", perl);
TEST_REGEX_SEARCH("a(b*)c\\g-1d", perl, "abbcbbd", match_default, make_array(0, 7, 1, 3, -2, -2));
TEST_REGEX_SEARCH("a(b*)c\\g-1d", perl, "abbcbd", match_default, make_array(-2, -2));
@@ -84,7 +88,7 @@ void test_backrefs()
TEST_REGEX_SEARCH("^(.)\\g1", perl, "abc", match_default, make_array(-2, -2));
TEST_REGEX_SEARCH("a([bc])\\g1d", perl, "abcdabbd", match_default, make_array(4, 8, 5, 6, -2, -2));
TEST_INVALID_REGEX("a(b)\\g{-2}c", perl);
- TEST_INVALID_REGEX("a(b\\g{-1})c", perl);
+ //TEST_INVALID_REGEX("a(b\\g{-1})c", perl);
TEST_REGEX_SEARCH("a(b*)c\\g{-1}d", perl, "abbcbbd", match_default, make_array(0, 7, 1, 3, -2, -2));
TEST_REGEX_SEARCH("a(b*)c\\g{-1}d", perl, "abbcbd", match_default, make_array(-2, -2));
TEST_REGEX_SEARCH("a(b*)c\\g{-1}d", perl, "abbcbbbd", match_default, make_array(-2, -2));
From a013cf3c5fb88f5d0c7dce65f21d9cf845261e65 Mon Sep 17 00:00:00 2001
From: jzmaddock
Date: Fri, 8 Oct 2021 17:47:42 +0100
Subject: [PATCH 08/20] Remove dead #include.
---
include/boost/regex/v5/basic_regex_creator.hpp | 2 --
1 file changed, 2 deletions(-)
diff --git a/include/boost/regex/v5/basic_regex_creator.hpp b/include/boost/regex/v5/basic_regex_creator.hpp
index 1dc7f046..da7827f6 100644
--- a/include/boost/regex/v5/basic_regex_creator.hpp
+++ b/include/boost/regex/v5/basic_regex_creator.hpp
@@ -20,8 +20,6 @@
#ifndef BOOST_REGEX_V5_BASIC_REGEX_CREATOR_HPP
#define BOOST_REGEX_V5_BASIC_REGEX_CREATOR_HPP
-#include
-
#ifdef BOOST_REGEX_MSVC
# pragma warning(push)
#pragma warning(disable:4459)
From 1e524968bb95f8b03c67d2f8e85ff87ed847a6f5 Mon Sep 17 00:00:00 2001
From: jzmaddock
Date: Sat, 9 Oct 2021 16:43:53 +0100
Subject: [PATCH 09/20] Fix missing #include, fix test cases.
---
.../boost/regex/v5/basic_regex_creator.hpp | 2 ++
test/regress/test_backrefs.cpp | 24 +++++++++++++++----
2 files changed, 21 insertions(+), 5 deletions(-)
diff --git a/include/boost/regex/v5/basic_regex_creator.hpp b/include/boost/regex/v5/basic_regex_creator.hpp
index da7827f6..82306d36 100644
--- a/include/boost/regex/v5/basic_regex_creator.hpp
+++ b/include/boost/regex/v5/basic_regex_creator.hpp
@@ -28,6 +28,8 @@
#endif
#endif
+#include
+
namespace boost{
namespace BOOST_REGEX_DETAIL_NS{
diff --git a/test/regress/test_backrefs.cpp b/test/regress/test_backrefs.cpp
index 20a77838..aafa8101 100644
--- a/test/regress/test_backrefs.cpp
+++ b/test/regress/test_backrefs.cpp
@@ -19,15 +19,19 @@ void test_backrefs()
{
using namespace boost::regex_constants;
TEST_INVALID_REGEX("a(b)\\2c", perl);
- //TEST_INVALID_REGEX("a(b\\1)c", perl);
+#ifdef BOOST_REGEX_CXX03
+ TEST_INVALID_REGEX("a(b\\1)c", perl);
+#endif
TEST_REGEX_SEARCH("a(b*)c\\1d", perl, "abbcbbd", match_default, make_array(0, 7, 1, 3, -2, -2));
TEST_REGEX_SEARCH("a(b*)c\\1d", perl, "abbcbd", match_default, make_array(-2, -2));
TEST_REGEX_SEARCH("a(b*)c\\1d", perl, "abbcbbbd", match_default, make_array(-2, -2));
TEST_REGEX_SEARCH("^(.)\\1", perl, "abc", match_default, make_array(-2, -2));
TEST_REGEX_SEARCH("a([bc])\\1d", perl, "abcdabbd", match_default, make_array(4, 8, 5, 6, -2, -2));
TEST_REGEX_SEARCH("a\\([bc]\\)\\1d", basic, "abcdabbd", match_default, make_array(4, 8, 5, 6, -2, -2));
+#ifndef BOOST_REGEX_CXX03
TEST_REGEX_SEARCH("(\\2two|(one))+", perl, "oneonetwo", match_default, make_array(0, 9, 3, 9, 0, 3, -2, -2));
TEST_INVALID_REGEX("(\\3two|(one))+", perl);
+#endif
// strictly speaking this is at best ambiguous, at worst wrong, this is what most
// re implimentations will match though.
TEST_REGEX_SEARCH("a(([bc])\\2)*d", perl, "abbccd", match_default, make_array(0, 6, 3, 5, 3, 4, -2, -2));
@@ -61,7 +65,9 @@ void test_backrefs()
// Now test the \g version:
//
TEST_INVALID_REGEX("a(b)\\g2c", perl);
- //TEST_INVALID_REGEX("a(b\\g1)c", perl);
+#ifdef BOOST_REGEX_CXX03
+ TEST_INVALID_REGEX("a(b\\g1)c", perl);
+#endif
TEST_INVALID_REGEX("a(b\\g0)c", perl);
TEST_REGEX_SEARCH("a(b*)c\\g1d", perl, "abbcbbd", match_default, make_array(0, 7, 1, 3, -2, -2));
TEST_REGEX_SEARCH("a(b*)c\\g1d", perl, "abbcbd", match_default, make_array(-2, -2));
@@ -69,10 +75,14 @@ void test_backrefs()
TEST_REGEX_SEARCH("^(.)\\g1", perl, "abc", match_default, make_array(-2, -2));
TEST_REGEX_SEARCH("a([bc])\\g1d", perl, "abcdabbd", match_default, make_array(4, 8, 5, 6, -2, -2));
TEST_INVALID_REGEX("a(b)\\g{2}c", perl);
- //TEST_INVALID_REGEX("a(b\\g{1})c", perl);
+#ifdef BOOST_REGEX_CXX03
+ TEST_INVALID_REGEX("a(b\\g{1})c", perl);
+#endif
TEST_INVALID_REGEX("a(b\\g{0})c", perl);
+#ifndef BOOST_REGEX_CXX03
TEST_REGEX_SEARCH("(\\g{2}two|(one))+", perl, "oneonetwo", match_default, make_array(0, 9, 3, 9, 0, 3, -2, -2));
TEST_INVALID_REGEX("(\\g{3}two|(one))+", perl);
+#endif
TEST_REGEX_SEARCH("a(b*)c\\g{1}d", perl, "abbcbbd", match_default, make_array(0, 7, 1, 3, -2, -2));
TEST_REGEX_SEARCH("a(b*)c\\g{1}d", perl, "abbcbd", match_default, make_array(-2, -2));
TEST_REGEX_SEARCH("a(b*)c\\g{1}d", perl, "abbcbbbd", match_default, make_array(-2, -2));
@@ -80,7 +90,9 @@ void test_backrefs()
TEST_REGEX_SEARCH("a([bc])\\g{1}d", perl, "abcdabbd", match_default, make_array(4, 8, 5, 6, -2, -2));
// And again but with negative indexes:
TEST_INVALID_REGEX("a(b)\\g-2c", perl);
- //TEST_INVALID_REGEX("a(b\\g-1)c", perl);
+#ifdef BOOST_REGEX_CXX03
+ TEST_INVALID_REGEX("a(b\\g-1)c", perl);
+#endif
TEST_INVALID_REGEX("a(b\\g-0)c", perl);
TEST_REGEX_SEARCH("a(b*)c\\g-1d", perl, "abbcbbd", match_default, make_array(0, 7, 1, 3, -2, -2));
TEST_REGEX_SEARCH("a(b*)c\\g-1d", perl, "abbcbd", match_default, make_array(-2, -2));
@@ -88,7 +100,9 @@ void test_backrefs()
TEST_REGEX_SEARCH("^(.)\\g1", perl, "abc", match_default, make_array(-2, -2));
TEST_REGEX_SEARCH("a([bc])\\g1d", perl, "abcdabbd", match_default, make_array(4, 8, 5, 6, -2, -2));
TEST_INVALID_REGEX("a(b)\\g{-2}c", perl);
- //TEST_INVALID_REGEX("a(b\\g{-1})c", perl);
+#ifdef BOOST_REGEX_CXX03
+ TEST_INVALID_REGEX("a(b\\g{-1})c", perl);
+#endif
TEST_REGEX_SEARCH("a(b*)c\\g{-1}d", perl, "abbcbbd", match_default, make_array(0, 7, 1, 3, -2, -2));
TEST_REGEX_SEARCH("a(b*)c\\g{-1}d", perl, "abbcbd", match_default, make_array(-2, -2));
TEST_REGEX_SEARCH("a(b*)c\\g{-1}d", perl, "abbcbbbd", match_default, make_array(-2, -2));
From fc25325cd27ab33428b0c769c9b4c417b0b99b9b Mon Sep 17 00:00:00 2001
From: jzmaddock
Date: Sun, 10 Oct 2021 15:51:51 +0100
Subject: [PATCH 10/20] Update ICU testing and usage.
---
.github/workflows/ci.yml | 18 ++++++-
CMakeLists.txt | 60 ++++++++++++++++++++---
doc/install.qbk | 4 ++
test/cmake_subdir_test_icu/CMakeLists.txt | 22 +++++++++
test/quick.cpp | 24 ++++-----
test/quick_icu.cpp | 55 +++++++++++++++++++++
6 files changed, 162 insertions(+), 21 deletions(-)
create mode 100644 test/cmake_subdir_test_icu/CMakeLists.txt
create mode 100644 test/quick_icu.cpp
diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml
index ce5e3275..0b14a6c7 100644
--- a/.github/workflows/ci.yml
+++ b/.github/workflows/ci.yml
@@ -27,7 +27,7 @@ jobs:
- 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
+ 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
@@ -78,7 +78,7 @@ jobs:
- 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
+ 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
@@ -331,6 +331,8 @@ jobs:
- 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
@@ -352,3 +354,15 @@ jobs:
cmake ..
cmake --build .
cmake --build . --target check
+ rm -rf *
+ cmake -DBOOST_REGEX_STANDALONE ..
+ cmake --build .
+ cmake --build . --target check
+ cd ../cmake_subdir_test_icu && mkdir __build__ && cd __build__
+ cmake ..
+ cmake --build .
+ cmake --build . --target check
+ rm -rf *
+ cmake -DBOOST_REGEX_STANDALONE ..
+ cmake --build .
+ cmake --build . --target check
diff --git a/CMakeLists.txt b/CMakeLists.txt
index 2fc093ef..ccd42230 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -13,11 +13,57 @@ add_library(Boost::regex ALIAS boost_regex)
target_include_directories(boost_regex INTERFACE include)
-target_link_libraries(boost_regex
- INTERFACE
- Boost::config
- Boost::throw_exception
- Boost::predef
- Boost::assert
-)
+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()
diff --git a/doc/install.qbk b/doc/install.qbk
index 041439ef..8f13568b 100644
--- a/doc/install.qbk
+++ b/doc/install.qbk
@@ -35,6 +35,10 @@ in order to do this you must either:
then the library will automoatically enter standalone mode. Or:
* Define BOOST_REGEX_STANDALONE when building.
+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 ``. Also note that the installed CMake file
+for Boost.Regex [/does not] list ICU as a dependency.
+
[h4 [*C++03 users only (Deprecated)] Building with bjam]
This is now the preferred method for building and installing this library,
diff --git a/test/cmake_subdir_test_icu/CMakeLists.txt b/test/cmake_subdir_test_icu/CMakeLists.txt
new file mode 100644
index 00000000..62e4f0a6
--- /dev/null
+++ b/test/cmake_subdir_test_icu/CMakeLists.txt
@@ -0,0 +1,22 @@
+# Copyright 2018, 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
+
+cmake_minimum_required(VERSION 3.5...3.16)
+
+project(cmake_subdir_test LANGUAGES CXX)
+
+add_subdirectory(../.. boostorg/regex)
+add_subdirectory(../../../config boostorg/config)
+add_subdirectory(../../../core boostorg/core)
+add_subdirectory(../../../assert boostorg/assert)
+add_subdirectory(../../../throw_exception boostorg/throw_exception)
+add_subdirectory(../../../predef boostorg/predef)
+
+add_executable(quick_icu ../quick_icu.cpp)
+target_link_libraries(quick_icu Boost::regex_icu)
+
+enable_testing()
+add_test(quick_icu quick_icu)
+
+add_custom_target(check COMMAND ${CMAKE_CTEST_COMMAND} --output-on-failure -C $)
diff --git a/test/quick.cpp b/test/quick.cpp
index 0598823d..649339c7 100644
--- a/test/quick.cpp
+++ b/test/quick.cpp
@@ -10,7 +10,7 @@
// See library home page at http://www.boost.org/libs/regex
#include
-#include
+#include
#include
bool validate_card_format(const std::string& s)
@@ -37,19 +37,19 @@ int main()
{
std::string s[ 4 ] = { "0000111122223333", "0000 1111 2222 3333", "0000-1111-2222-3333", "000-1111-2222-3333" };
- BOOST_TEST( !validate_card_format( s[0] ) );
- BOOST_TEST_EQ( machine_readable_card_number( s[0] ), s[0] );
- BOOST_TEST_EQ( human_readable_card_number( s[0] ), s[2] );
+ assert(!validate_card_format(s[0]));
+ assert(machine_readable_card_number(s[0]) == s[0]);
+ assert(human_readable_card_number(s[0]) == s[2]);
- BOOST_TEST( validate_card_format( s[1] ) );
- BOOST_TEST_EQ( machine_readable_card_number( s[1] ), s[0] );
- BOOST_TEST_EQ( human_readable_card_number( s[1] ), s[2] );
+ assert(validate_card_format(s[1]));
+ assert(machine_readable_card_number(s[1]) == s[0]);
+ assert(human_readable_card_number(s[1]) == s[2]);
- BOOST_TEST( validate_card_format( s[2] ) );
- BOOST_TEST_EQ( machine_readable_card_number( s[2] ), s[0] );
- BOOST_TEST_EQ( human_readable_card_number( s[2] ), s[2] );
+ assert(validate_card_format(s[2]));
+ assert(machine_readable_card_number(s[2]) == s[0]);
+ assert(human_readable_card_number(s[2]) == s[2]);
- BOOST_TEST( !validate_card_format( s[3] ) );
+ assert(!validate_card_format(s[3]));
- return boost::report_errors();
+ return 0;
}
diff --git a/test/quick_icu.cpp b/test/quick_icu.cpp
new file mode 100644
index 00000000..74058c00
--- /dev/null
+++ b/test/quick_icu.cpp
@@ -0,0 +1,55 @@
+
+// Copyright 1998-2002 John Maddock
+// Copyright 2017 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
+
+// See library home page at http://www.boost.org/libs/regex
+
+#include
+#include
+#include
+
+bool validate_card_format(const std::string& s)
+{
+ static const boost::u32regex e = boost::make_u32regex("(\\d{4}[- ]){3}\\d{4}");
+ return boost::u32regex_match(s, e);
+}
+
+const boost::u32regex card_rx = boost::make_u32regex("\\A(\\d{3,4})[- ]?(\\d{4})[- ]?(\\d{4})[- ]?(\\d{4})\\z");
+const std::string machine_format("\\1\\2\\3\\4");
+const std::string human_format("\\1-\\2-\\3-\\4");
+
+std::string machine_readable_card_number(const std::string& s)
+{
+ return boost::u32regex_replace(s, card_rx, machine_format, boost::match_default | boost::format_sed);
+}
+
+std::string human_readable_card_number(const std::string& s)
+{
+ return boost::u32regex_replace(s, card_rx, human_format, boost::match_default | boost::format_sed);
+}
+
+int main()
+{
+ std::string s[ 4 ] = { "0000111122223333", "0000 1111 2222 3333", "0000-1111-2222-3333", "000-1111-2222-3333" };
+
+ assert( !validate_card_format( s[0] ) );
+ assert( machine_readable_card_number( s[0] ) == s[0] );
+ assert( human_readable_card_number( s[0] ) == s[2] );
+
+ assert( validate_card_format( s[1] ) );
+ assert( machine_readable_card_number( s[1] ) == s[0] );
+ assert( human_readable_card_number( s[1] ) == s[2] );
+
+ assert( validate_card_format( s[2] ) );
+ assert( machine_readable_card_number( s[2] ) == s[0] );
+ assert( human_readable_card_number( s[2] ) == s[2] );
+
+ assert( !validate_card_format( s[3] ) );
+
+ return 0;
+}
From a99e2c3b2cedaf568bebd1123adbd10f18e39746 Mon Sep 17 00:00:00 2001
From: jzmaddock
Date: Sun, 10 Oct 2021 16:41:19 +0100
Subject: [PATCH 11/20] Update documentation for ICU usage. Regenerate docs.
---
doc/html/boost_regex/background.html | 4 +-
.../background/acknowledgements.html | 2 +-
doc/html/boost_regex/background/examples.html | 2 +-
doc/html/boost_regex/background/faq.html | 2 +-
doc/html/boost_regex/background/futher.html | 2 +-
doc/html/boost_regex/background/headers.html | 2 +-
doc/html/boost_regex/background/history.html | 71 +++++++++++++------
doc/html/boost_regex/background/locale.html | 2 +-
.../boost_regex/background/performance.html | 2 +-
.../performance/section_id1378460593.html | 2 +-
.../performance/section_id1675827111.html | 2 +-
.../performance/section_id3141719723.html | 2 +-
.../performance/section_id3258595385.html | 2 +-
.../performance/section_id3261825021.html | 2 +-
.../performance/section_id3752650613.html | 2 +-
.../performance/section_id4128344975.html | 2 +-
.../performance/section_id4148872883.html | 2 +-
doc/html/boost_regex/background/redist.html | 2 +-
.../boost_regex/background/standards.html | 2 +-
.../boost_regex/background/thread_safety.html | 2 +-
doc/html/boost_regex/captures.html | 4 +-
doc/html/boost_regex/configuration.html | 8 ++-
.../boost_regex/configuration/compiler.html | 8 +--
.../boost_regex/configuration/locale.html | 8 +--
.../boost_regex/configuration/tuning.html | 2 +-
doc/html/boost_regex/format.html | 4 +-
.../format/boost_format_syntax.html | 2 +-
doc/html/boost_regex/format/perl_format.html | 2 +-
doc/html/boost_regex/format/sed_format.html | 2 +-
doc/html/boost_regex/install.html | 49 +++++++++++--
doc/html/boost_regex/intro.html | 4 +-
doc/html/boost_regex/partial_matches.html | 4 +-
doc/html/boost_regex/ref.html | 4 +-
doc/html/boost_regex/ref/bad_expression.html | 2 +-
doc/html/boost_regex/ref/basic_regex.html | 2 +-
doc/html/boost_regex/ref/concepts.html | 2 +-
.../ref/concepts/charT_concept.html | 2 +-
.../ref/concepts/iterator_concepts.html | 2 +-
.../ref/concepts/traits_concept.html | 2 +-
doc/html/boost_regex/ref/deprecated.html | 2 +-
.../boost_regex/ref/deprecated/old_regex.html | 2 +-
.../ref/deprecated/regex_format.html | 2 +-
.../ref/deprecated/regex_grep.html | 2 +-
.../ref/deprecated/regex_split.html | 2 +-
doc/html/boost_regex/ref/error_type.html | 2 +-
doc/html/boost_regex/ref/internals.html | 2 +-
.../boost_regex/ref/internals/uni_iter.html | 2 +-
doc/html/boost_regex/ref/match_flag_type.html | 2 +-
doc/html/boost_regex/ref/match_results.html | 2 +-
doc/html/boost_regex/ref/non_std_strings.html | 2 +-
.../boost_regex/ref/non_std_strings/icu.html | 2 +-
.../ref/non_std_strings/icu/intro.html | 11 +--
.../ref/non_std_strings/icu/unicode_algo.html | 2 +-
.../ref/non_std_strings/icu/unicode_iter.html | 2 +-
.../non_std_strings/icu/unicode_types.html | 2 +-
.../ref/non_std_strings/mfc_strings.html | 2 +-
.../non_std_strings/mfc_strings/mfc_algo.html | 2 +-
.../mfc_strings/mfc_intro.html | 2 +-
.../non_std_strings/mfc_strings/mfc_iter.html | 2 +-
.../mfc_strings/mfc_regex_create.html | 2 +-
.../mfc_strings/mfc_regex_types.html | 2 +-
doc/html/boost_regex/ref/posix.html | 2 +-
doc/html/boost_regex/ref/regex_iterator.html | 2 +-
doc/html/boost_regex/ref/regex_match.html | 2 +-
doc/html/boost_regex/ref/regex_replace.html | 2 +-
doc/html/boost_regex/ref/regex_search.html | 2 +-
.../boost_regex/ref/regex_token_iterator.html | 2 +-
doc/html/boost_regex/ref/regex_traits.html | 2 +-
doc/html/boost_regex/ref/sub_match.html | 2 +-
.../boost_regex/ref/syntax_option_type.html | 2 +-
.../syntax_option_type_basic.html | 2 +-
.../syntax_option_type_extended.html | 2 +-
.../syntax_option_type_literal.html | 2 +-
.../syntax_option_type_overview.html | 2 +-
.../syntax_option_type_perl.html | 2 +-
.../syntax_option_type_synopsis.html | 2 +-
doc/html/boost_regex/syntax.html | 4 +-
.../boost_regex/syntax/basic_extended.html | 2 +-
doc/html/boost_regex/syntax/basic_syntax.html | 2 +-
.../boost_regex/syntax/character_classes.html | 2 +-
.../optional_char_class_names.html | 2 +-
.../character_classes/std_char_classes.html | 2 +-
.../boost_regex/syntax/collating_names.html | 2 +-
.../syntax/collating_names/digraphs.html | 2 +-
.../syntax/collating_names/named_unicode.html | 2 +-
.../collating_names/posix_symbolic_names.html | 2 +-
.../syntax/leftmost_longest_rule.html | 2 +-
doc/html/boost_regex/syntax/perl_syntax.html | 2 +-
doc/html/boost_regex/unicode.html | 13 ++--
doc/html/index.html | 10 +--
doc/icu_strings.qbk | 7 +-
doc/install.qbk | 20 ++++--
doc/unicode.qbk | 5 +-
93 files changed, 233 insertions(+), 155 deletions(-)
diff --git a/doc/html/boost_regex/background.html b/doc/html/boost_regex/background.html
index 426e00dc..56e8ac4e 100644
--- a/doc/html/boost_regex/background.html
+++ b/doc/html/boost_regex/background.html
@@ -4,8 +4,8 @@
Background Information
-
-
+
+
diff --git a/doc/html/boost_regex/background/acknowledgements.html b/doc/html/boost_regex/background/acknowledgements.html
index af25e802..a129b3ff 100644
--- a/doc/html/boost_regex/background/acknowledgements.html
+++ b/doc/html/boost_regex/background/acknowledgements.html
@@ -4,7 +4,7 @@
Acknowledgements
-
+
diff --git a/doc/html/boost_regex/background/examples.html b/doc/html/boost_regex/background/examples.html
index 4c8fb18f..5222e586 100644
--- a/doc/html/boost_regex/background/examples.html
+++ b/doc/html/boost_regex/background/examples.html
@@ -4,7 +4,7 @@
Test and Example Programs
-
+
diff --git a/doc/html/boost_regex/background/faq.html b/doc/html/boost_regex/background/faq.html
index c5c60367..9928883c 100644
--- a/doc/html/boost_regex/background/faq.html
+++ b/doc/html/boost_regex/background/faq.html
@@ -4,7 +4,7 @@
FAQ
-
+
diff --git a/doc/html/boost_regex/background/futher.html b/doc/html/boost_regex/background/futher.html
index 14f59e3f..6501b1be 100644
--- a/doc/html/boost_regex/background/futher.html
+++ b/doc/html/boost_regex/background/futher.html
@@ -4,7 +4,7 @@
References and Further Information
-
+
diff --git a/doc/html/boost_regex/background/headers.html b/doc/html/boost_regex/background/headers.html
index 88707122..ea964e17 100644
--- a/doc/html/boost_regex/background/headers.html
+++ b/doc/html/boost_regex/background/headers.html
@@ -4,7 +4,7 @@
Headers
-
+
diff --git a/doc/html/boost_regex/background/history.html b/doc/html/boost_regex/background/history.html
index 8421ab54..f329fd41 100644
--- a/doc/html/boost_regex/background/history.html
+++ b/doc/html/boost_regex/background/history.html
@@ -4,7 +4,7 @@
History
-
+
@@ -36,6 +36,33 @@
+
+-
+ 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.
+
+
+
+
+-
+ Big change to header only library.
+
+-
+ Deprecate C++03 support.
+
+
+
@@ -43,7 +70,7 @@
Minor build fixes, see #89.
@@ -57,7 +84,7 @@
@@ -78,7 +105,7 @@
@@ -86,7 +113,7 @@
Change to lockfree implementation of memory cache, see PR#23.
@@ -109,7 +136,7 @@
@@ -142,7 +169,7 @@
@@ -175,14 +202,14 @@
Fixed issue #8569.
@@ -190,7 +217,7 @@
#7644.
@@ -200,7 +227,7 @@
#6346.
@@ -209,7 +236,7 @@
expression.
@@ -219,7 +246,7 @@
#5736.
@@ -232,7 +259,7 @@
#5504.
@@ -251,7 +278,7 @@
#3890
@@ -280,7 +307,7 @@
@@ -289,7 +316,7 @@
branch resets and recursive regular expressions.
@@ -317,7 +344,7 @@
@@ -340,7 +367,7 @@
@@ -410,7 +437,7 @@
@@ -465,7 +492,7 @@
@@ -473,7 +500,7 @@
Fixed bug in partial matches of bounded repeats of '.'.
diff --git a/doc/html/boost_regex/background/locale.html b/doc/html/boost_regex/background/locale.html
index e679a550..5d5f0cd2 100644
--- a/doc/html/boost_regex/background/locale.html
+++ b/doc/html/boost_regex/background/locale.html
@@ -4,7 +4,7 @@
Localization
-
+
diff --git a/doc/html/boost_regex/background/performance.html b/doc/html/boost_regex/background/performance.html
index 3a0ca9ad..e84f6465 100644
--- a/doc/html/boost_regex/background/performance.html
+++ b/doc/html/boost_regex/background/performance.html
@@ -4,7 +4,7 @@
Performance
-
+
diff --git a/doc/html/boost_regex/background/performance/section_id1378460593.html b/doc/html/boost_regex/background/performance/section_id1378460593.html
index 872020dc..60b9852e 100644
--- a/doc/html/boost_regex/background/performance/section_id1378460593.html
+++ b/doc/html/boost_regex/background/performance/section_id1378460593.html
@@ -4,7 +4,7 @@
Testing simple leftmost-longest matches (platform = linux, compiler = GNU C++ version 6.3.0)
-
+
diff --git a/doc/html/boost_regex/background/performance/section_id1675827111.html b/doc/html/boost_regex/background/performance/section_id1675827111.html
index 72b2bc8c..43cafa56 100644
--- a/doc/html/boost_regex/background/performance/section_id1675827111.html
+++ b/doc/html/boost_regex/background/performance/section_id1675827111.html
@@ -4,7 +4,7 @@
Testing Perl searches (platform = linux, compiler = GNU C++ version 6.3.0)
-
+
diff --git a/doc/html/boost_regex/background/performance/section_id3141719723.html b/doc/html/boost_regex/background/performance/section_id3141719723.html
index 129834c6..b9c91f9d 100644
--- a/doc/html/boost_regex/background/performance/section_id3141719723.html
+++ b/doc/html/boost_regex/background/performance/section_id3141719723.html
@@ -4,7 +4,7 @@
Testing simple leftmost-longest matches (platform = Windows x64, compiler = Microsoft Visual C++ version 14.1)
-
+
diff --git a/doc/html/boost_regex/background/performance/section_id3258595385.html b/doc/html/boost_regex/background/performance/section_id3258595385.html
index 716f62b9..ecc996e6 100644
--- a/doc/html/boost_regex/background/performance/section_id3258595385.html
+++ b/doc/html/boost_regex/background/performance/section_id3258595385.html
@@ -4,7 +4,7 @@
Testing leftmost-longest searches (platform = Windows x64, compiler = Microsoft Visual C++ version 14.1)
-
+
diff --git a/doc/html/boost_regex/background/performance/section_id3261825021.html b/doc/html/boost_regex/background/performance/section_id3261825021.html
index b71be600..b243694a 100644
--- a/doc/html/boost_regex/background/performance/section_id3261825021.html
+++ b/doc/html/boost_regex/background/performance/section_id3261825021.html
@@ -4,7 +4,7 @@
Testing simple Perl matches (platform = linux, compiler = GNU C++ version 6.3.0)
-
+
diff --git a/doc/html/boost_regex/background/performance/section_id3752650613.html b/doc/html/boost_regex/background/performance/section_id3752650613.html
index 67b83440..ac11c594 100644
--- a/doc/html/boost_regex/background/performance/section_id3752650613.html
+++ b/doc/html/boost_regex/background/performance/section_id3752650613.html
@@ -4,7 +4,7 @@
Testing Perl searches (platform = Windows x64, compiler = Microsoft Visual C++ version 14.1)
-
+
diff --git a/doc/html/boost_regex/background/performance/section_id4128344975.html b/doc/html/boost_regex/background/performance/section_id4128344975.html
index 89720415..d77b3ae2 100644
--- a/doc/html/boost_regex/background/performance/section_id4128344975.html
+++ b/doc/html/boost_regex/background/performance/section_id4128344975.html
@@ -4,7 +4,7 @@
Testing simple Perl matches (platform = Windows x64, compiler = Microsoft Visual C++ version 14.1)
-
+
diff --git a/doc/html/boost_regex/background/performance/section_id4148872883.html b/doc/html/boost_regex/background/performance/section_id4148872883.html
index 8495bf1a..f9876309 100644
--- a/doc/html/boost_regex/background/performance/section_id4148872883.html
+++ b/doc/html/boost_regex/background/performance/section_id4148872883.html
@@ -4,7 +4,7 @@
Testing leftmost-longest searches (platform = linux, compiler = GNU C++ version 6.3.0)
-
+
diff --git a/doc/html/boost_regex/background/redist.html b/doc/html/boost_regex/background/redist.html
index ef12c43f..4f85a62a 100644
--- a/doc/html/boost_regex/background/redist.html
+++ b/doc/html/boost_regex/background/redist.html
@@ -4,7 +4,7 @@
Redistributables
-
+
diff --git a/doc/html/boost_regex/background/standards.html b/doc/html/boost_regex/background/standards.html
index aeecebf3..817b51fb 100644
--- a/doc/html/boost_regex/background/standards.html
+++ b/doc/html/boost_regex/background/standards.html
@@ -4,7 +4,7 @@
Standards Conformance
-
+
diff --git a/doc/html/boost_regex/background/thread_safety.html b/doc/html/boost_regex/background/thread_safety.html
index 1f1fb819..7ba59e9a 100644
--- a/doc/html/boost_regex/background/thread_safety.html
+++ b/doc/html/boost_regex/background/thread_safety.html
@@ -4,7 +4,7 @@
Thread Safety
-
+
diff --git a/doc/html/boost_regex/captures.html b/doc/html/boost_regex/captures.html
index 55e59822..ef532ae5 100644
--- a/doc/html/boost_regex/captures.html
+++ b/doc/html/boost_regex/captures.html
@@ -4,8 +4,8 @@
Understanding Marked Sub-Expressions and Captures
-
-
+
+
diff --git a/doc/html/boost_regex/configuration.html b/doc/html/boost_regex/configuration.html
index bfc70b20..0f2e9468 100644
--- a/doc/html/boost_regex/configuration.html
+++ b/doc/html/boost_regex/configuration.html
@@ -4,9 +4,9 @@
Configuration
-
-
-
+
+
+
@@ -28,6 +28,8 @@