PCRE2 C++ Wrapper 1.2.4
pcre2cpp
Loading...
Searching...
No Matches
compile_options.hpp
Go to the documentation of this file.
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
20 #if !_PCRE2CPP_HAS_CXX17
21_PCRE2CPP_ERROR("This is only available for c++17 and greater!");
22 #else
23
24 #include <pcre2cpp/types.hpp>
25
26namespace pcre2cpp {
31 enum class compile_options_bits : uint32_t {
33 None = 0u,
35 Anchored = PCRE2_ANCHORED,
37 AllowEmptyClass = PCRE2_ALLOW_EMPTY_CLASS,
39 AltBSUX = PCRE2_ALT_BSUX,
41 AltCircumflex = PCRE2_ALT_CIRCUMFLEX,
43 AltVerbNames = PCRE2_ALT_VERBNAMES,
45 AutoCallout = PCRE2_AUTO_CALLOUT,
47 Caseless = PCRE2_CASELESS,
49 DollarEndonly = PCRE2_DOLLAR_ENDONLY,
51 DotAll = PCRE2_DOTALL,
53 DupNames = PCRE2_DUPNAMES,
55 EndAnchored = PCRE2_ENDANCHORED,
57 Extended = PCRE2_EXTENDED,
59 FirstLine = PCRE2_FIRSTLINE,
61 Literal = PCRE2_LITERAL,
63 MatchInvalidUTF = PCRE2_MATCH_INVALID_UTF,
65 MatchUnsetBackRef = PCRE2_MATCH_UNSET_BACKREF,
67 Multiline = PCRE2_MULTILINE,
69 NeverBackslashC = PCRE2_NEVER_BACKSLASH_C,
71 NeverUCP = PCRE2_NEVER_UCP,
73 NeverUTF = PCRE2_NEVER_UTF,
75 NoAutoCapture = PCRE2_NO_AUTO_CAPTURE,
77 NoAutoPossess = PCRE2_NO_AUTO_POSSESS,
79 NoDotStarAnchor = PCRE2_NO_DOTSTAR_ANCHOR,
81 NoStartOptimize = PCRE2_NO_START_OPTIMIZE,
83 NoUTFCheck = PCRE2_NO_UTF_CHECK,
85 UCP = PCRE2_UCP,
87 UnGreedy = PCRE2_UNGREEDY,
89 UseOffsetLimit = PCRE2_USE_OFFSET_LIMIT,
91 UTF = PCRE2_UTF
92 };
93
98 using compile_options = mstd::flags<compile_options_bits>;
99
107 const compile_options_bits opt1) noexcept {
108 return mstd::operator|(opt0, opt1);
109 }
110} // namespace pcre2cpp
111 #endif
112#endif
compile_options_bits
Compile options.
Definition pcre2cpp.hpp:1556
mstd::flags< compile_options_bits > compile_options
Compile options flags group.
Definition pcre2cpp.hpp:1623
@ NoAutoPossess
Disable auto - possessification.
Definition pcre2cpp.hpp:1602
@ MatchUnsetBackRef
Match unset backreferences.
Definition pcre2cpp.hpp:1590
@ DollarEndonly
$ not to match newline at end
Definition pcre2cpp.hpp:1574
@ Caseless
Do caseless matching.
Definition pcre2cpp.hpp:1572
@ AllowEmptyClass
Allow empty classes.
Definition pcre2cpp.hpp:1562
@ DotAll
. matches anything including NL
Definition pcre2cpp.hpp:1576
@ NoDotStarAnchor
Disable automatic anchoring for .*.
Definition pcre2cpp.hpp:1604
@ NeverUCP
Lock out PCRE2_UCP, e.g.via(*UCP).
Definition pcre2cpp.hpp:1596
@ AutoCallout
Compile automatic callouts.
Definition pcre2cpp.hpp:1570
@ AltVerbNames
Process backslashes in verb names.
Definition pcre2cpp.hpp:1568
@ AltCircumflex
Alternative handling of ^ in multiline mode.
Definition pcre2cpp.hpp:1566
@ NoStartOptimize
Disable match - time start optimizations.
Definition pcre2cpp.hpp:1606
@ Multiline
^ and $ match newlines within data
Definition pcre2cpp.hpp:1592
@ UnGreedy
Invert greediness of quantifiers.
Definition pcre2cpp.hpp:1612
@ UTF
Treat pattern and subjects as UTF strings.
Definition pcre2cpp.hpp:1616
@ NoAutoCapture
Disable numbered capturing paren - theses(named ones available).
Definition pcre2cpp.hpp:1600
@ UseOffsetLimit
Enable offset limit for unanchored matching.
Definition pcre2cpp.hpp:1614
@ MatchInvalidUTF
Enable support for matching invalid UTF.
Definition pcre2cpp.hpp:1588
@ AltBSUX
Alternative handling of \u, \U, and \x.
Definition pcre2cpp.hpp:1564
@ NeverUTF
Lock out PCRE2_UTF, e.g.via(*UTF).
Definition pcre2cpp.hpp:1598
@ FirstLine
Force matching to be before newline.
Definition pcre2cpp.hpp:1584
@ DupNames
Allow duplicate names for subpatterns.
Definition pcre2cpp.hpp:1578
@ Literal
Pattern characters are all literal.
Definition pcre2cpp.hpp:1586
@ NeverBackslashC
Lock out the use of \C in patterns.
Definition pcre2cpp.hpp:1594
@ Extended
Ignore white space and # comments.
Definition pcre2cpp.hpp:1582
@ UCP
Use Unicode properties for \d, \w, etc.
Definition pcre2cpp.hpp:1610
@ None
No options set (default).
Definition pcre2cpp.hpp:967
@ NoUTFCheck
Do not check the subject for UTF validity(only relevant if compile_options::UTF was set at compile ti...
Definition pcre2cpp.hpp:987
@ Anchored
Match only at the first position.
Definition pcre2cpp.hpp:969
@ EndAnchored
Pattern can match only at end of subject.
Definition pcre2cpp.hpp:975
#define _PCRE2CPP_CONSTEXPR17
constexpr for c++17 and higher
Definition config.hpp:239
#define _PCRE2CPP_ERROR(MESSAGE)
compiler error
Definition config.hpp:278
Main namespace of pcre2cpp library.