2
3
4
5
6
7
8
9
10
11
12
13
16#ifndef _PCRE2CPP_REGEX_HPP_
17 #define _PCRE2CPP_REGEX_HPP_
19 #include <pcre2cpp/config.hpp>
22_PCRE2CPP_ERROR(
"This is only available for c++17 and greater!");
25 #include <pcre2cpp/exceptions/exceptions.hpp>
26 #include <pcre2cpp/match/match_error_codes.hpp>
27 #include <pcre2cpp/match/match_options.hpp>
28 #include <pcre2cpp/match/match_result.hpp>
29 #include <pcre2cpp/regex/compile_options.hpp>
30 #include <pcre2cpp/types.hpp>
31 #include <pcre2cpp/utils/pcre2_data.hpp>
35
36
37
38
186 const size_t offset = 0)
const noexcept {
199 size_t offset = 0)
const noexcept {
243 if (
code ==
nullptr) {
return false; }
Basic container to result data of match function.
Definition match_result.hpp:84
base pcre2cpp exception class
Definition exceptions.hpp:134
Basic PCRE2 Regex container.
Definition regex.hpp:40
typename _pcre2_data_t::match_data_type _match_data_type
Definition regex.hpp:46
typename _pcre2_data_t::string_type _string_type
Definition regex.hpp:48
_PCRE2CPP_CONSTEXPR17 basic_regex(const basic_regex &other) noexcept=default
default copy constructor
_code_ptr _code
pointer to compiled pcre2 code
Definition regex.hpp:62
typename _pcre2_data_t::string_view_type _string_view_type
Definition regex.hpp:49
typename _pcre2_data_t::uchar_type _uchar_type
Definition regex.hpp:56
_PCRE2CPP_CONSTEXPR20 bool match(const _string_view_type text, _match_result_type &result, const size_t offset=0, const match_options opts=match_options_bits::None) const noexcept
returns true if match was found and result is stored in result variable
Definition regex.hpp:139
std::shared_ptr< _named_sub_values_table > _named_sub_values_table_ptr
Definition regex.hpp:55
_PCRE2CPP_CONSTEXPR17 bool match_all(const _string_view_type text, std::vector< _match_result_type > &results, size_t offset=0) const noexcept
returns true if any match was found and all results store in results array
Definition regex.hpp:198
_PCRE2CPP_CONSTEXPR20 basic_regex(const _string_view_type pattern, const compile_options opts=compile_options_bits::None) _PCRE2CPP_NOEXCEPT
basic regex container with pattern and compile options
Definition regex.hpp:70
_named_sub_values_table_ptr _named_sub_values
pointer to conversion table of named groups to their index
Definition regex.hpp:66
_PCRE2CPP_CONSTEXPR17 bool match(const _string_view_type text, const size_t offset=0, const match_options opts=match_options_bits::None) const _PCRE2CPP_NOEXCEPT
returns true if match was found
Definition regex.hpp:130
_match_data_ptr _match_data
pointer to match data of pcre2 code
Definition regex.hpp:64
typename _pcre2_data_t::string_char_type _string_char_type
Definition regex.hpp:50
basic_match_result< utf > _match_result_type
Definition regex.hpp:52
basic_match_value< utf > _match_value_type
Definition regex.hpp:51
_PCRE2CPP_CONSTEXPR17 bool match_at(const _string_view_type text, _match_result_type &result, const size_t offset=0) const noexcept
returns true if match was found, and it has relative offset == 0 and result is stored in result varia...
Definition regex.hpp:185
std::shared_ptr< _code_type > _code_ptr
Definition regex.hpp:45
typename _pcre2_data_t::sptr_type _sptr_type
Definition regex.hpp:53
_PCRE2CPP_CONSTEXPR17 basic_regex & operator=(basic_regex &&other) noexcept=default
default move assign operator
_PCRE2CPP_CONSTEXPR17 basic_regex & operator=(const basic_regex &other) noexcept=default
default copy assign operator
utils::pcre2_data< utf > _pcre2_data_t
Definition regex.hpp:42
std::shared_ptr< _match_data_type > _match_data_ptr
Definition regex.hpp:47
_PCRE2CPP_CONSTEXPR17 basic_regex(basic_regex &&other) noexcept=default
default move constructor
_PCRE2CPP_CONSTEXPR20 ~basic_regex() noexcept=default
default destructor
_PCRE2CPP_CONSTEXPR17 bool match_at(const _string_view_type text, const size_t offset=0) const noexcept
returns true if match was found, and it has relative offset == 0
Definition regex.hpp:179
typename _pcre2_data_t::named_sub_values_table _named_sub_values_table
Definition regex.hpp:54
typename _pcre2_data_t::code_type _code_type
Definition regex.hpp:44
#define _PCRE2CPP_NOEXCEPT
Definition config.hpp:176
static constexpr auto default_utf_type
default utf type for types like regex etc...
Definition pcre2_data.hpp:50
utf_type
Enum with supported utf types.
Definition pcre2_data.hpp:31
@ UTF_16
value for UTF-16 support
Definition pcre2_data.hpp:38
@ UTF_32
value for UTF-32 support
Definition pcre2_data.hpp:42
@ UTF_8
value for UTF-8 support
Definition pcre2_data.hpp:34
#define _PCRE2CPP_CONSTEXPR17
constexpr for c++17 and higher
Definition config.hpp:236
#define _PCRE2CPP_CONSTEXPR20
constexpr keyword for c++20 and higher
Definition config.hpp:253
#define _PCRE2CPP_HAS_UTF32
check if support for UTF-32 is enabled
Definition config.hpp:215
#define _PCRE2CPP_HAS_CXX17
check if compiler has c++ version greater or equal to c++17
Definition config.hpp:133
#define _PCRE2CPP_HAS_UTF8
check if support for UTF-8 is enabled
Definition config.hpp:203
#define _PCRE2CPP_HAS_UTF16
check if support for UTF-16 is enabled
Definition config.hpp:209
#define _PCRE2CPP_HAS_EXCEPTIONS
check if exceptions are enabled
Definition config.hpp:171
basic_regex< utf_type::UTF_16 > u16regex
Definition regex.hpp:221
basic_regex< utf_type::UTF_32 > u32regex
Definition regex.hpp:224
basic_regex< default_utf_type > regex
Definition regex.hpp:227
bool is_pattern_valid(const typename utils::pcre2_data< utf >::string_view_type pattern, const compile_options opts=compile_options_bits::None) noexcept
Definition regex.hpp:230
basic_regex< utf_type::UTF_8 > u8regex
Definition regex.hpp:218
Match value container.
Definition match_result.hpp:39
Translation container from pcre2 library to pcre2cpp.
Definition pcre2_data.hpp:68