PCRE2 C++ Wrapper 1.2.4
pcre2cpp
Loading...
Searching...
No Matches
match_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_REGEX_MATCH_OPTIONS_HPP_
16 #define _PCRE2CPP_REGEX_MATCH_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 match_options_bits : uint32_t {
33 None = 0u,
35 Anchored = PCRE2_ANCHORED,
37 CopyMatchedSubject = PCRE2_COPY_MATCHED_SUBJECT,
39 DisableRecurseLoopCheck = PCRE2_DISABLE_RECURSELOOP_CHECK,
41 EndAnchored = PCRE2_ENDANCHORED,
43 NotBOL = PCRE2_NOTBOL,
45 NotEOL = PCRE2_NOTEOL,
47 NotEmpty = PCRE2_NOTEMPTY,
49 NotEmptyAtStart = PCRE2_NOTEMPTY_ATSTART,
51 NoJIT = PCRE2_NO_JIT,
53 NoUTFCheck = PCRE2_NO_UTF_CHECK,
55 PartialHard = PCRE2_PARTIAL_HARD,
57 PartialSoft = PCRE2_PARTIAL_SOFT
58 };
59
64 using match_options = mstd::flags<match_options_bits>;
65
73 static _PCRE2CPP_CONSTEXPR17 match_options operator|(const match_options_bits opt0, const match_options_bits opt1) noexcept {
74 return mstd::operator|(opt0, opt1);
75 }
76} // namespace pcre2cpp
77 #endif
78#endif
match_options_bits
Match options.
Definition pcre2cpp.hpp:965
mstd::flags< match_options_bits > match_options
Match options flags group.
Definition pcre2cpp.hpp:998
@ NotEOL
Subject string is not the end of a line.
Definition pcre2cpp.hpp:979
@ PartialHard
Return match_error_codes::Partial for a partial match even if there is a full match.
Definition pcre2cpp.hpp:989
@ NotBOL
Subject string is not the beginning of a line.
Definition pcre2cpp.hpp:977
@ NotEmpty
An empty string is not a valid match.
Definition pcre2cpp.hpp:981
@ PartialSoft
Return match_error_codes::Partial for a partial match if no full matches are found.
Definition pcre2cpp.hpp:991
@ None
No options set (default).
Definition pcre2cpp.hpp:967
@ CopyMatchedSubject
On success, make a private subject copy.
Definition pcre2cpp.hpp:971
@ 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
@ NotEmptyAtStart
An empty string at the start of the subject is not a valid match.
Definition pcre2cpp.hpp:983
@ EndAnchored
Pattern can match only at end of subject.
Definition pcre2cpp.hpp:975
@ DisableRecurseLoopCheck
Only useful in rare cases; use with care.
Definition pcre2cpp.hpp:973
@ NoJIT
Do not use JIT matching.
Definition pcre2cpp.hpp:985
#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.