PCRE2 C++ Wrapper 1.3.0
pcre2cpp
Loading...
Searching...
No Matches
compile_options.hpp
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#ifndef _PCRE2CPP_COMPILE_OPTIONS_HPP_
16 #define _PCRE2CPP_COMPILE_OPTIONS_HPP_
17
18 #include <pcre2cpp/config.hpp>
19
21_PCRE2CPP_ERROR("This is only available for c++17 and greater!");
22 #else
23
24 #include <pcre2cpp/types.hpp>
25
26namespace pcre2cpp {
27 /**
28 * @brief Compile options
29 * @ingroup pcre2cpp
30 */
32 /// @brief No options set (default)
33 None = 0u,
34 /// @brief Force pattern anchoring
36 /// @brief Allow empty classes
38 /// @brief Alternative handling of \\u, \\U, and \\x
40 /// @brief Alternative handling of ^ in multiline mode
42 /// @brief Process backslashes in verb names
44 /// @brief Compile automatic callouts
46 /// @brief Do caseless matching
48 /// @brief $ not to match newline at end
50 /// @brief . matches anything including NL
52 /// @brief Allow duplicate names for subpatterns
54 /// @brief Pattern can match only at end of subject
56 /// @brief Ignore white space and # comments
58 /// @brief Force matching to be before newline
60 /// @brief Pattern characters are all literal
62 /// @brief Enable support for matching invalid UTF
64 /// @brief Match unset backreferences
66 /// @brief ^ and $ match newlines within data
68 /// @brief Lock out the use of \\C in patterns
70 /// @brief Lock out PCRE2_UCP, e.g.via(*UCP)
72 /// @brief Lock out PCRE2_UTF, e.g.via(*UTF)
74 /// @brief Disable numbered capturing paren - theses(named ones available)
76 /// @brief Disable auto - possessification
78 /// @brief Disable automatic anchoring for .*
80 /// @brief Disable match - time start optimizations
82 /// @brief Do not check the pattern for UTF validity (only relevant if PCRE2_UTF is set)
84 /// @brief Use Unicode properties for \\d, \\w, etc.
86 /// @brief Invert greediness of quantifiers
88 /// @brief Enable offset limit for unanchored matching
90 /// @brief Treat pattern and subjects as UTF strings
92 };
93
94 /**
95 * @brief Compile options flags group
96 * @ingroup pcre2cpp
97 */
99
100 /**
101 * @brief operator for combining compile options to one flags group
102 * @param opt0 first compile option
103 * @param opt1 second compile option
104 * @return Compile options flags group created from two compile options
105 */
107 const compile_options_bits opt1) noexcept {
108 return mstd::operator|(opt0, opt1);
109 }
110} // namespace pcre2cpp
111 #endif
112#endif
base pcre2cpp exception class
Definition exceptions.hpp:134
compile_options_bits
Compile options.
Definition compile_options.hpp:31
@ NoAutoPossess
Disable auto - possessification.
Definition compile_options.hpp:77
@ MatchUnsetBackRef
Match unset backreferences.
Definition compile_options.hpp:65
@ DollarEndonly
$ not to match newline at end
Definition compile_options.hpp:49
@ Caseless
Do caseless matching.
Definition compile_options.hpp:47
@ AllowEmptyClass
Allow empty classes.
Definition compile_options.hpp:37
@ DotAll
. matches anything including NL
Definition compile_options.hpp:51
@ NoDotStarAnchor
Disable automatic anchoring for .*.
Definition compile_options.hpp:79
@ NeverUCP
Lock out PCRE2_UCP, e.g.via(*UCP).
Definition compile_options.hpp:71
@ AutoCallout
Compile automatic callouts.
Definition compile_options.hpp:45
@ AltVerbNames
Process backslashes in verb names.
Definition compile_options.hpp:43
@ AltCircumflex
Alternative handling of ^ in multiline mode.
Definition compile_options.hpp:41
@ NoStartOptimize
Disable match - time start optimizations.
Definition compile_options.hpp:81
@ None
No options set (default).
Definition compile_options.hpp:33
@ Multiline
^ and $ match newlines within data
Definition compile_options.hpp:67
@ UnGreedy
Invert greediness of quantifiers.
Definition compile_options.hpp:87
@ NoUTFCheck
Do not check the pattern for UTF validity (only relevant if PCRE2_UTF is set).
Definition compile_options.hpp:83
@ UTF
Treat pattern and subjects as UTF strings.
Definition compile_options.hpp:91
@ NoAutoCapture
Disable numbered capturing paren - theses(named ones available).
Definition compile_options.hpp:75
@ UseOffsetLimit
Enable offset limit for unanchored matching.
Definition compile_options.hpp:89
@ MatchInvalidUTF
Enable support for matching invalid UTF.
Definition compile_options.hpp:63
@ AltBSUX
Alternative handling of \u, \U, and \x.
Definition compile_options.hpp:39
@ NeverUTF
Lock out PCRE2_UTF, e.g.via(*UTF).
Definition compile_options.hpp:73
@ Anchored
Force pattern anchoring.
Definition compile_options.hpp:35
@ FirstLine
Force matching to be before newline.
Definition compile_options.hpp:59
@ DupNames
Allow duplicate names for subpatterns.
Definition compile_options.hpp:53
@ Literal
Pattern characters are all literal.
Definition compile_options.hpp:61
@ EndAnchored
Pattern can match only at end of subject.
Definition compile_options.hpp:55
@ NeverBackslashC
Lock out the use of \C in patterns.
Definition compile_options.hpp:69
@ Extended
Ignore white space and # comments.
Definition compile_options.hpp:57
@ UCP
Use Unicode properties for \d, \w, etc.
Definition compile_options.hpp:85
#define _PCRE2CPP_CONSTEXPR17
constexpr for c++17 and higher
Definition config.hpp:236
#define _PCRE2CPP_HAS_CXX17
check if compiler has c++ version greater or equal to c++17
Definition config.hpp:133
static _PCRE2CPP_CONSTEXPR17 compile_options operator|(const compile_options_bits opt0, const compile_options_bits opt1) noexcept
operator for combining compile options to one flags group
Definition compile_options.hpp:106