Skip to content

Commit ae97e6f

Browse files
committed
Fixed compile_options and match_options
1 parent 3c84f75 commit ae97e6f

7 files changed

Lines changed: 131 additions & 122 deletions

File tree

CMakeLists.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
cmake_minimum_required(VERSION 3.16)
2-
project(pcre2cpp VERSION 1.1.1 LANGUAGES CXX)
2+
project(pcre2cpp VERSION 1.1.2 LANGUAGES CXX)
33

44
set(CMAKE_CXX_STANDARD 20)
55
set(CMAKE_CXX_STANDARD_REQUIRED ON)

include/pcre2cpp/pcre2cpp.hpp

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,8 @@
1717
#include "pcre2cpp_libs.hpp"
1818
#include "pcre2cpp_types.hpp"
1919
#include "pcre2_data.hpp"
20+
#include "regex_compile_options.hpp"
21+
#include "regex_match_options.hpp"
2022
#include "pcre2cpp_exceptions.hpp"
2123
#include "match_result.hpp"
2224
#include "regex.hpp"

include/pcre2cpp/pcre2cpp_config.hpp

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@
1717
#pragma region VERSION
1818
#define PCRE2CPP_VERSION_MAJOR 1
1919
#define PCRE2CPP_VERSION_MINOR 1
20-
#define PCRE2CPP_VERSION_PATCH 1
20+
#define PCRE2CPP_VERSION_PATCH 2
2121

2222
#define _PCRE2CPP_STRINGIFY_HELPER(x) #x
2323

@@ -36,8 +36,8 @@
3636
#pragma endregion VERSION
3737

3838
#pragma region LAST_UPDATE
39-
#define PCRE2CPP_LAST_UPDATE_DAY 24
40-
#define PCRE2CPP_LAST_UPDATE_MONTH 9
39+
#define PCRE2CPP_LAST_UPDATE_DAY 02
40+
#define PCRE2CPP_LAST_UPDATE_MONTH 12
4141
#define PCRE2CPP_LAST_UPDATE_YEAR 2025
4242

4343
#define _PCRE2CPP_LAST_UPDATE_DATE_HELPER(day, month, year) _PCRE2CPP_STRINGIFY_HELPER(day)"."\

include/pcre2cpp/pcre2cpp_types.hpp

Lines changed: 0 additions & 49 deletions
Original file line numberDiff line numberDiff line change
@@ -42,53 +42,4 @@ namespace pcre2cpp {
4242
using regex = basic_regex<8>;
4343
using wregex = basic_regex<16>;
4444
using regex_32 = basic_regex<32>;
45-
46-
enum class regex_compile_options : uint32_t {
47-
NONE = 0, // No options set (default)
48-
ANCHORED = PCRE2_ANCHORED, // Force pattern anchoring
49-
ALLOW_EMPTY_CLASS = PCRE2_ALLOW_EMPTY_CLASS, // Allow empty classes
50-
ALT_BSUX = PCRE2_ALT_BSUX, // Alternative handling of \u, \U, and \x
51-
ALT_CIRCUMFLEX = PCRE2_ALT_CIRCUMFLEX, // Alternative handling of ^ in multiline mode
52-
ALT_VERBNAMES = PCRE2_ALT_VERBNAMES, // Process backslashes in verb names
53-
AUTO_CALLOUT = PCRE2_AUTO_CALLOUT, // Compile automatic callouts
54-
CASELESS = PCRE2_CASELESS, // Do caseless matching
55-
DOLLAR_ENDONLY = PCRE2_DOLLAR_ENDONLY, // $ not to match newline at end
56-
DOTALL = PCRE2_DOTALL, // . matches anything including NL
57-
DUPNAMES = PCRE2_DUPNAMES, // Allow duplicate names for subpatterns
58-
ENDANCHORED = PCRE2_ENDANCHORED, // Pattern can match only at end of subject
59-
EXTENDED = PCRE2_EXTENDED, // Ignore white space and # comments
60-
FIRSTLINE = PCRE2_FIRSTLINE, // Force matching to be before newline
61-
LITERAL = PCRE2_LITERAL, // Pattern characters are all literal
62-
MATCH_INVALID_UTF = PCRE2_MATCH_INVALID_UTF, // Enable support for matching invalid UTF
63-
MATCH_UNSET_BACKREF = PCRE2_MATCH_UNSET_BACKREF, // Match unset backreferences
64-
MULTILINE = PCRE2_MULTILINE, // ^ and $ match newlines within data
65-
NEVER_BACKSLASH_C = PCRE2_NEVER_BACKSLASH_C, // Lock out the use of \C in patterns
66-
NEVER_UCP = PCRE2_NEVER_UCP, // Lock out PCRE2_UCP, e.g.via(*UCP)
67-
NEVER_UTF = PCRE2_NEVER_UTF, // Lock out PCRE2_UTF, e.g.via(*UTF)
68-
NO_AUTO_CAPTURE = PCRE2_NO_AUTO_CAPTURE, // Disable numbered capturing paren - theses(named ones available)
69-
NO_AUTO_POSSESS = PCRE2_NO_AUTO_POSSESS, // Disable auto - possessification
70-
NO_DOTSTAR_ANCHOR = PCRE2_NO_DOTSTAR_ANCHOR, // Disable automatic anchoring for .*
71-
NO_START_OPTIMIZE = PCRE2_NO_START_OPTIMIZE, // Disable match - time start optimizations
72-
NO_UTF_CHECK = PCRE2_NO_UTF_CHECK, // Do not check the pattern for UTF validity (only relevant if PCRE2_UTF is set)
73-
UCP = PCRE2_UCP, // Use Unicode properties for \d, \w, etc.
74-
UNGREEDY = PCRE2_UNGREEDY, // Invert greediness of quantifiers
75-
USE_OFFSET_LIMIT = PCRE2_USE_OFFSET_LIMIT, // Enable offset limit for unanchored matching
76-
UTF = PCRE2_UTF, // Treat pattern and subjects as UTF strings
77-
};
78-
79-
enum class regex_match_options : uint32_t {
80-
NONE = 0, // No options set (default)
81-
ANCHORED = PCRE2_ANCHORED, // Match only at the first position
82-
COPY_MATCHED_SUBJECT = PCRE2_COPY_MATCHED_SUBJECT, // On success, make a private subject copy
83-
DISABLE_RECURSELOOP_CHECK = PCRE2_DISABLE_RECURSELOOP_CHECK, // Only useful in rare cases; use with care
84-
ENDANCHORED = PCRE2_ENDANCHORED, // Pattern can match only at end of subject
85-
NOTBOL = PCRE2_NOTBOL, // Subject string is not the beginning of a line
86-
NOTEOL = PCRE2_NOTEOL, // Subject string is not the end of a line
87-
NOTEMPTY = PCRE2_NOTEMPTY, // An empty string is not a valid match
88-
NOTEMPTY_ATSTART = PCRE2_NOTEMPTY_ATSTART, // An empty string at the start of the subject is not a valid match
89-
NO_JIT = PCRE2_NO_JIT, // Do not use JIT matching
90-
NO_UTF_CHECK = PCRE2_NO_UTF_CHECK, // Do not check the subject for UTF validity(only relevant if PCRE2_UTF was set at compile time)
91-
PARTIAL_HARD = PCRE2_PARTIAL_HARD, // Return PCRE2_ERROR_PARTIAL for a partial match even if there is a full match
92-
PARTIAL_SOFT = PCRE2_PARTIAL_SOFT // Return PCRE2_ERROR_PARTIAL for a partial match if no full matches are found
93-
};
9445
}

include/pcre2cpp/regex.hpp

Lines changed: 26 additions & 69 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,8 @@
1515
#pragma once
1616
#include "pcre2cpp_types.hpp"
1717
#include "pcre2_data.hpp"
18+
#include "regex_compile_options.hpp"
19+
#include "regex_match_options.hpp"
1820

1921
namespace pcre2cpp {
2022
template<size_t utf>
@@ -36,14 +38,14 @@ namespace pcre2cpp {
3638
_named_sub_values_table_ptr _named_sub_values = nullptr;
3739

3840
public:
39-
constexpr basic_regex(const _string_char_type* pattern, size_t pattern_size,
40-
regex_compile_options opts = regex_compile_options::NONE) {
41+
constexpr explicit basic_regex(const _string_char_type* pattern, size_t pattern_size,
42+
regex_compile_options opts = static_cast<regex_compile_options>(regex_compile_options_bits::NONE)) {
4143

4244
// Compile Code
4345
int error_code = 0;
4446
size_t error_offset = 0;
45-
_code_type* code = _pcre2_data<utf>::compile((_string_ptr_type)pattern,
46-
pattern_size, (uint32_t)opts, &error_code, &error_offset, nullptr);
47+
_code_type* code = _pcre2_data<utf>::compile(reinterpret_cast<_string_ptr_type>(pattern),
48+
pattern_size, opts, &error_code, &error_offset, nullptr);
4749

4850
if (code == nullptr) {
4951
throw basic_regex_exception<utf>(error_code, error_offset);
@@ -69,61 +71,49 @@ namespace pcre2cpp {
6971
while (*entry_end != '\0' && entry_end - entry < name_entry_size - 3) {
7072
entry_end += 1;
7173
}
72-
(*_named_sub_values)[_string_type(entry, entry_end)] = ((size_t)index) - 1;
74+
(*_named_sub_values)[_string_type(entry, entry_end)] = static_cast<size_t>(index) - 1;
7375
}
7476

7577
// Create Match Data
7678
_match_data_type* match_data = _pcre2_data<utf>::match_data_from_pattern(_code.get(), nullptr);
7779
_match_data = std::shared_ptr<_match_data_type>(match_data, _pcre2_data<utf>::match_data_free);
7880
}
79-
constexpr basic_regex(const _string_type& pattern,
80-
regex_compile_options opts = regex_compile_options::NONE)
81+
constexpr explicit basic_regex(const _string_type& pattern,
82+
regex_compile_options opts = static_cast<regex_compile_options>(regex_compile_options_bits::NONE))
8183
: basic_regex(pattern.c_str(), pattern.length(), opts) {}
8284
template<size_t N>
83-
constexpr basic_regex(const _string_char_type (&pattern)[N],
84-
regex_compile_options opts = regex_compile_options::NONE)
85+
constexpr explicit basic_regex(const _string_char_type(&pattern)[N],
86+
regex_compile_options opts = static_cast<regex_compile_options>(regex_compile_options_bits::NONE))
8587
: basic_regex(pattern, N - 1, opts) {}
88+
8689
constexpr basic_regex(const basic_regex<utf>& r) noexcept = default;
90+
8791
virtual ~basic_regex() = default;
8892

8993
constexpr basic_regex<utf>& operator=(const basic_regex<utf>& r) noexcept = default;
9094

9195
#pragma region MATCH
92-
constexpr bool match(const _string_char_type* text, size_t text_size,
93-
regex_match_options opts, size_t offset = 0) const {
96+
constexpr bool match(const _string_char_type* text, size_t text_size, size_t offset = 0,
97+
regex_match_options opts = static_cast<regex_match_options>(regex_match_options_bits::NONE)) const {
9498
int match_code =
95-
_pcre2_data<utf>::match(_code.get(), (_string_ptr_type)text,
96-
text_size, offset, (uint32_t)opts, _match_data.get(), nullptr);
99+
_pcre2_data<utf>::match(_code.get(), reinterpret_cast<_string_ptr_type>(text),
100+
text_size, offset, opts, _match_data.get(), nullptr);
97101

98102
return match_code > 0 && match_code != PCRE2_ERROR_NOMATCH;
99103
}
100-
constexpr bool match(const _string_type& text, regex_match_options opts, size_t offset = 0) const {
101-
return match(text.c_str(), text.length(), opts, offset);
102-
}
103-
template<size_t N>
104-
constexpr bool match(const _string_char_type(&text)[N], regex_match_options opts, size_t offset = 0) const {
105-
return match(text, N - 1, opts, offset);
106-
}
107-
108-
constexpr bool match(const _string_char_type* text, size_t text_size, size_t offset = 0) const {
109-
return match(text, text_size, regex_match_options::NONE, offset);
110-
}
111-
constexpr bool match(const _string_type& text, size_t offset = 0) const {
112-
return match(text.c_str(), text.length(), offset);
104+
constexpr bool match(const _string_type& text, size_t offset = 0,
105+
regex_match_options opts = static_cast<regex_match_options>(regex_match_options_bits::NONE)) const {
106+
return match(text.c_str(), text.length(), offset, opts);
113107
}
114-
template<size_t N>
115-
constexpr bool match(const _string_char_type(&text)[N], size_t offset = 0) const {
116-
return match(text, N - 1, offset);
117-
}
118-
119108
#pragma endregion MATCH
120109

121110
#pragma region MATCH_WITH_RESULT
122111
constexpr bool match(const _string_char_type* text, size_t text_size,
123-
_match_result_type& result, regex_match_options opts, size_t offset = 0) const {
112+
_match_result_type& result, size_t offset = 0,
113+
regex_match_options opts = static_cast<regex_match_options>(regex_match_options_bits::NONE)) const {
124114
int match_code =
125-
_pcre2_data<utf>::match(_code.get(), (_string_ptr_type)text,
126-
text_size, offset, (uint32_t)opts, _match_data.get(), nullptr);
115+
_pcre2_data<utf>::match(_code.get(), reinterpret_cast<_string_ptr_type>(text),
116+
text_size, offset, static_cast<uint32_t>(opts), _match_data.get(), nullptr);
127117

128118
if (match_code > 0 && match_code != PCRE2_ERROR_NOMATCH) {
129119
size_t* ovector = _pcre2_data<utf>::get_ovector_ptr(_match_data.get());
@@ -147,25 +137,8 @@ namespace pcre2cpp {
147137
return false;
148138
}
149139
constexpr bool match(const _string_type& text, _match_result_type& result,
150-
regex_match_options opts, size_t offset = 0) const {
151-
return match(text.c_str(), text.length(), result, opts, offset);
152-
}
153-
template<size_t N>
154-
constexpr bool match(const _string_char_type (&text)[N], _match_result_type& result,
155-
regex_match_options opts, size_t offset = 0) const {
156-
return match(text, N - 1, result, opts, offset);
157-
}
158-
159-
constexpr bool match(const _string_char_type* text, size_t text_size,
160-
_match_result_type& result, size_t offset = 0) const {
161-
return match(text, text_size, result, regex_match_options::NONE, offset);
162-
}
163-
constexpr bool match(const _string_type& text, _match_result_type& result, size_t offset = 0) const {
164-
return match(text.c_str(), text.length(), result, offset);
165-
}
166-
template<size_t N>
167-
constexpr bool match(const _string_char_type(&text)[N], _match_result_type& result, size_t offset = 0) const {
168-
return match(text, N - 1, result, offset);
140+
size_t offset = 0, regex_match_options opts = static_cast<regex_match_options>(regex_match_options_bits::NONE)) const {
141+
return match(text.c_str(), text.length(), result, offset, opts);
169142
}
170143
#pragma endregion MATCH_WITH_RESULT
171144

@@ -177,10 +150,6 @@ namespace pcre2cpp {
177150
constexpr bool match_at(const _string_type& text, size_t offset = 0) const {
178151
return match_at(text.c_str(), text.length(), offset);
179152
}
180-
template<size_t N>
181-
constexpr bool match_at(const _string_char_type(&text)[N], size_t offset = 0) const {
182-
return match_at(text, N - 1, offset);
183-
}
184153
#pragma endregion MATCH_AT
185154

186155
#pragma region MATCH_AT_WITH_RESULT
@@ -199,10 +168,6 @@ namespace pcre2cpp {
199168
constexpr bool match_at(const _string_type& text, _match_result_type& result, size_t offset = 0) const {
200169
return match_at(text.c_str(), text.length(), result, offset);
201170
}
202-
template<size_t N>
203-
constexpr bool match_at(const _string_char_type(&text)[N], _match_result_type& result, size_t offset = 0) const {
204-
return match_at(text, N - 1, result, offset);
205-
}
206171
#pragma endregion MATCH_AT_WITH_RESULT
207172

208173
#pragma region MATCH_ALL_WITH_RESULT
@@ -224,10 +189,6 @@ namespace pcre2cpp {
224189
constexpr bool match_all(const _string_type& text, std::vector<_match_result_type>& results, size_t offset = 0) const {
225190
return match_all(text.c_str(), text.length(), results, offset);
226191
}
227-
template<size_t N>
228-
constexpr bool match_all(const _string_char_type(&text)[N], std::vector<_match_result_type>& results, size_t offset = 0) const {
229-
return match_all(text, N - 1, results, offset);
230-
}
231192

232193
constexpr bool match_all(const _string_char_type* text, size_t text_size, _match_result_type*& results, size_t& results_count, size_t offset = 0) const {
233194
std::vector<_match_result_type> temp_results;
@@ -244,10 +205,6 @@ namespace pcre2cpp {
244205
constexpr bool match_all(const _string_type& text, _match_result_type*& results, size_t& results_count, size_t offset = 0) const {
245206
return match_all(text.c_str(), text.length(), results, results_count, offset);
246207
}
247-
template<size_t N>
248-
constexpr bool match_all(const _string_char_type(&text)[N], _match_result_type*& results, size_t& results_count, size_t offset = 0) const {
249-
return match_all(text, N - 1, results, results_count, offset);
250-
}
251208
#pragma endregion MATCH_ALL_WITH_RESULT
252209
};
253210
}
Lines changed: 58 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,58 @@
1+
/*
2+
* pcre2cpp - PCRE2 cpp wrapper
3+
*
4+
* Licensed under the BSD 3-Clause License with Attribution Requirement.
5+
* See the LICENSE file for details: https://github.com/MAIPA01/pcre2cpp/blob/main/LICENSE
6+
*
7+
* Copyright (c) 2025, Patryk Antosik (MAIPA01)
8+
*
9+
* PCRE2 library included in this project:
10+
* Copyright (c) 2016-2024, University of Cambridge.
11+
*
12+
* See the LICENSE_PCRE2 file for details: https://github.com/MAIPA01/pcre2cpp/blob/main/LICENSE_PCRE2
13+
*/
14+
#pragma once
15+
#include "pcre2cpp_types.hpp"
16+
17+
enum class regex_compile_options_bits : uint32_t {
18+
NONE = 0u, // No options set (default)
19+
ANCHORED = PCRE2_ANCHORED, // Force pattern anchoring
20+
ALLOW_EMPTY_CLASS = PCRE2_ALLOW_EMPTY_CLASS, // Allow empty classes
21+
ALT_BSUX = PCRE2_ALT_BSUX, // Alternative handling of \u, \U, and \x
22+
ALT_CIRCUMFLEX = PCRE2_ALT_CIRCUMFLEX, // Alternative handling of ^ in multiline mode
23+
ALT_VERBNAMES = PCRE2_ALT_VERBNAMES, // Process backslashes in verb names
24+
AUTO_CALLOUT = PCRE2_AUTO_CALLOUT, // Compile automatic callouts
25+
CASELESS = PCRE2_CASELESS, // Do caseless matching
26+
DOLLAR_ENDONLY = PCRE2_DOLLAR_ENDONLY, // $ not to match newline at end
27+
DOTALL = PCRE2_DOTALL, // . matches anything including NL
28+
DUPNAMES = PCRE2_DUPNAMES, // Allow duplicate names for subpatterns
29+
ENDANCHORED = PCRE2_ENDANCHORED, // Pattern can match only at end of subject
30+
EXTENDED = PCRE2_EXTENDED, // Ignore white space and # comments
31+
FIRSTLINE = PCRE2_FIRSTLINE, // Force matching to be before newline
32+
LITERAL = PCRE2_LITERAL, // Pattern characters are all literal
33+
MATCH_INVALID_UTF = PCRE2_MATCH_INVALID_UTF, // Enable support for matching invalid UTF
34+
MATCH_UNSET_BACKREF = PCRE2_MATCH_UNSET_BACKREF, // Match unset backreferences
35+
MULTILINE = PCRE2_MULTILINE, // ^ and $ match newlines within data
36+
NEVER_BACKSLASH_C = PCRE2_NEVER_BACKSLASH_C, // Lock out the use of \C in patterns
37+
NEVER_UCP = PCRE2_NEVER_UCP, // Lock out PCRE2_UCP, e.g.via(*UCP)
38+
NEVER_UTF = PCRE2_NEVER_UTF, // Lock out PCRE2_UTF, e.g.via(*UTF)
39+
NO_AUTO_CAPTURE = PCRE2_NO_AUTO_CAPTURE, // Disable numbered capturing paren - theses(named ones available)
40+
NO_AUTO_POSSESS = PCRE2_NO_AUTO_POSSESS, // Disable auto - possessification
41+
NO_DOTSTAR_ANCHOR = PCRE2_NO_DOTSTAR_ANCHOR, // Disable automatic anchoring for .*
42+
NO_START_OPTIMIZE = PCRE2_NO_START_OPTIMIZE, // Disable match - time start optimizations
43+
NO_UTF_CHECK = PCRE2_NO_UTF_CHECK, // Do not check the pattern for UTF validity (only relevant if PCRE2_UTF is set)
44+
UCP = PCRE2_UCP, // Use Unicode properties for \d, \w, etc.
45+
UNGREEDY = PCRE2_UNGREEDY, // Invert greediness of quantifiers
46+
USE_OFFSET_LIMIT = PCRE2_USE_OFFSET_LIMIT, // Enable offset limit for unanchored matching
47+
UTF = PCRE2_UTF // Treat pattern and subjects as UTF strings
48+
};
49+
50+
using regex_compile_options = uint32_t;
51+
52+
constexpr static regex_compile_options operator| (const regex_compile_options_bits& opt0, const regex_compile_options_bits& opt1) {
53+
return static_cast<regex_compile_options>(static_cast<uint32_t>(opt0) | static_cast<uint32_t>(opt1));
54+
}
55+
56+
constexpr static regex_compile_options operator| (const regex_compile_options& opts, const regex_compile_options_bits& opt) {
57+
return static_cast<regex_compile_options>(opts | static_cast<uint32_t>(opt));
58+
}
Lines changed: 41 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,41 @@
1+
/*
2+
* pcre2cpp - PCRE2 cpp wrapper
3+
*
4+
* Licensed under the BSD 3-Clause License with Attribution Requirement.
5+
* See the LICENSE file for details: https://github.com/MAIPA01/pcre2cpp/blob/main/LICENSE
6+
*
7+
* Copyright (c) 2025, Patryk Antosik (MAIPA01)
8+
*
9+
* PCRE2 library included in this project:
10+
* Copyright (c) 2016-2024, University of Cambridge.
11+
*
12+
* See the LICENSE_PCRE2 file for details: https://github.com/MAIPA01/pcre2cpp/blob/main/LICENSE_PCRE2
13+
*/
14+
#pragma once
15+
#include "pcre2cpp_types.hpp"
16+
17+
enum class regex_match_options_bits : uint32_t {
18+
NONE = 0u, // No options set (default)
19+
ANCHORED = PCRE2_ANCHORED, // Match only at the first position
20+
COPY_MATCHED_SUBJECT = PCRE2_COPY_MATCHED_SUBJECT, // On success, make a private subject copy
21+
DISABLE_RECURSELOOP_CHECK = PCRE2_DISABLE_RECURSELOOP_CHECK, // Only useful in rare cases; use with care
22+
ENDANCHORED = PCRE2_ENDANCHORED, // Pattern can match only at end of subject
23+
NOTBOL = PCRE2_NOTBOL, // Subject string is not the beginning of a line
24+
NOTEOL = PCRE2_NOTEOL, // Subject string is not the end of a line
25+
NOTEMPTY = PCRE2_NOTEMPTY, // An empty string is not a valid match
26+
NOTEMPTY_ATSTART = PCRE2_NOTEMPTY_ATSTART, // An empty string at the start of the subject is not a valid match
27+
NO_JIT = PCRE2_NO_JIT, // Do not use JIT matching
28+
NO_UTF_CHECK = PCRE2_NO_UTF_CHECK, // Do not check the subject for UTF validity(only relevant if PCRE2_UTF was set at compile time)
29+
PARTIAL_HARD = PCRE2_PARTIAL_HARD, // Return PCRE2_ERROR_PARTIAL for a partial match even if there is a full match
30+
PARTIAL_SOFT = PCRE2_PARTIAL_SOFT // Return PCRE2_ERROR_PARTIAL for a partial match if no full matches are found
31+
};
32+
33+
using regex_match_options = uint32_t;
34+
35+
constexpr static regex_match_options operator| (const regex_match_options_bits& opt0, const regex_match_options_bits& opt1) {
36+
return static_cast<regex_match_options>(static_cast<uint32_t>(opt0) | static_cast<uint32_t>(opt1));
37+
}
38+
39+
constexpr static regex_match_options operator| (const regex_match_options& opts, const regex_match_options_bits& opt) {
40+
return static_cast<regex_match_options>(opts | static_cast<uint32_t>(opt));
41+
}

0 commit comments

Comments
 (0)