1414#pragma once
1515#include " pcre2cpp_types.hpp"
1616
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- };
17+ namespace pcre2cpp {
18+ enum class regex_compile_options_bits : uint32_t {
19+ NONE = 0u , // No options set (default)
20+ ANCHORED = PCRE2_ANCHORED , // Force pattern anchoring
21+ ALLOW_EMPTY_CLASS = PCRE2_ALLOW_EMPTY_CLASS , // Allow empty classes
22+ ALT_BSUX = PCRE2_ALT_BSUX , // Alternative handling of \u, \U, and \x
23+ ALT_CIRCUMFLEX = PCRE2_ALT_CIRCUMFLEX , // Alternative handling of ^ in multiline mode
24+ ALT_VERBNAMES = PCRE2_ALT_VERBNAMES , // Process backslashes in verb names
25+ AUTO_CALLOUT = PCRE2_AUTO_CALLOUT , // Compile automatic callouts
26+ CASELESS = PCRE2_CASELESS , // Do caseless matching
27+ DOLLAR_ENDONLY = PCRE2_DOLLAR_ENDONLY , // $ not to match newline at end
28+ DOTALL = PCRE2_DOTALL , // . matches anything including NL
29+ DUPNAMES = PCRE2_DUPNAMES , // Allow duplicate names for subpatterns
30+ ENDANCHORED = PCRE2_ENDANCHORED , // Pattern can match only at end of subject
31+ EXTENDED = PCRE2_EXTENDED , // Ignore white space and # comments
32+ FIRSTLINE = PCRE2_FIRSTLINE , // Force matching to be before newline
33+ LITERAL = PCRE2_LITERAL , // Pattern characters are all literal
34+ MATCH_INVALID_UTF = PCRE2_MATCH_INVALID_UTF , // Enable support for matching invalid UTF
35+ MATCH_UNSET_BACKREF = PCRE2_MATCH_UNSET_BACKREF , // Match unset backreferences
36+ MULTILINE = PCRE2_MULTILINE , // ^ and $ match newlines within data
37+ NEVER_BACKSLASH_C = PCRE2_NEVER_BACKSLASH_C , // Lock out the use of \C in patterns
38+ NEVER_UCP = PCRE2_NEVER_UCP , // Lock out PCRE2_UCP, e.g.via(*UCP)
39+ NEVER_UTF = PCRE2_NEVER_UTF , // Lock out PCRE2_UTF, e.g.via(*UTF)
40+ NO_AUTO_CAPTURE = PCRE2_NO_AUTO_CAPTURE , // Disable numbered capturing paren - theses(named ones available)
41+ NO_AUTO_POSSESS = PCRE2_NO_AUTO_POSSESS , // Disable auto - possessification
42+ NO_DOTSTAR_ANCHOR = PCRE2_NO_DOTSTAR_ANCHOR , // Disable automatic anchoring for .*
43+ NO_START_OPTIMIZE = PCRE2_NO_START_OPTIMIZE , // Disable match - time start optimizations
44+ NO_UTF_CHECK = PCRE2_NO_UTF_CHECK , // Do not check the pattern for UTF validity (only relevant if PCRE2_UTF is set)
45+ UCP = PCRE2_UCP , // Use Unicode properties for \d, \w, etc.
46+ UNGREEDY = PCRE2_UNGREEDY , // Invert greediness of quantifiers
47+ USE_OFFSET_LIMIT = PCRE2_USE_OFFSET_LIMIT , // Enable offset limit for unanchored matching
48+ UTF = PCRE2_UTF // Treat pattern and subjects as UTF strings
49+ };
4950
50- using regex_compile_options = uint32_t ;
51+ using regex_compile_options = uint32_t ;
5152
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- }
53+ constexpr static regex_compile_options operator | (const regex_compile_options_bits& opt0, const regex_compile_options_bits& opt1) {
54+ return static_cast <regex_compile_options>(static_cast <uint32_t >(opt0) | static_cast <uint32_t >(opt1));
55+ }
5556
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));
57+ constexpr static regex_compile_options operator | (const regex_compile_options& opts, const regex_compile_options_bits& opt) {
58+ return static_cast <regex_compile_options>(opts | static_cast <uint32_t >(opt));
59+ }
5860}
0 commit comments