PCRE2 C++ Wrapper 1.3.0
pcre2cpp
Loading...
Searching...
No Matches
pcre2cpp Namespace Reference

Main namespace of pcre2cpp library. More...

Namespaces

namespace  uitls
 Utility namespace of pcre2cpp library.
namespace  utils

Classes

class  basic_pcre2cpp_exception
 base pcre2cpp exception class More...
class  basic_regex_exception
 regex exception class More...
class  basic_match_result_exception
 match result exception class More...
struct  basic_match_value
 Match value container. More...
struct  sub_match_value
 Sub match value container. More...
class  basic_match_result
 Basic container to result data of match function. More...
class  basic_regex
 Basic PCRE2 Regex container. More...

Typedefs

using u8pcre2cpp_exception = basic_pcre2cpp_exception<utf_type::UTF_8>
using u16pcre2cpp_exception = basic_pcre2cpp_exception<utf_type::UTF_16>
using u32pcre2cpp_exception = basic_pcre2cpp_exception<utf_type::UTF_32>
using pcre2cpp_exception = basic_pcre2cpp_exception<default_utf_type>
using u8regex_exception = basic_regex_exception<utf_type::UTF_8>
using u16regex_exception = basic_regex_exception<utf_type::UTF_16>
using u32regex_exception = basic_regex_exception<utf_type::UTF_32>
using regex_exception = basic_regex_exception<default_utf_type>
using u8match_result_exception = basic_match_result_exception<utf_type::UTF_8>
using u16match_result_exception = basic_match_result_exception<utf_type::UTF_16>
using u32match_result_exception = basic_match_result_exception<utf_type::UTF_32>
using match_result_exception = basic_match_result_exception<default_utf_type>
using match_options = mstd::flags<match_options_bits>
 Match options flags group.
using u8match_value = basic_match_value<utf_type::UTF_8>
using u16match_value = basic_match_value<utf_type::UTF_16>
using u32match_value = basic_match_value<utf_type::UTF_32>
using match_value = basic_match_value<default_utf_type>
using u8match_result = basic_match_result<utf_type::UTF_8>
using u16match_result = basic_match_result<utf_type::UTF_16>
using u32match_result = basic_match_result<utf_type::UTF_32>
using match_result = basic_match_result<default_utf_type>
using compile_options = mstd::flags<compile_options_bits>
 Compile options flags group.
using u8regex = basic_regex<utf_type::UTF_8>
using u16regex = basic_regex<utf_type::UTF_16>
using u32regex = basic_regex<utf_type::UTF_32>
using regex = basic_regex<default_utf_type>

Enumerations

enum class  match_error_codes : int32_t {
  match_error_codes::None = 1 , match_error_codes::NoMatch = PCRE2_ERROR_NOMATCH , match_error_codes::Partial = PCRE2_ERROR_PARTIAL , match_error_codes::BadMagic = PCRE2_ERROR_BADMAGIC ,
  match_error_codes::BadMode = PCRE2_ERROR_BADMODE , match_error_codes::BadOffset = PCRE2_ERROR_BADOFFSET , match_error_codes::BadOption = PCRE2_ERROR_BADOPTION , match_error_codes::BadUTFOffset = PCRE2_ERROR_BADUTFOFFSET ,
  match_error_codes::Callout = PCRE2_ERROR_CALLOUT , match_error_codes::DepthLimit = PCRE2_ERROR_DEPTHLIMIT , match_error_codes::HeapLimit = PCRE2_ERROR_HEAPLIMIT , match_error_codes::Internal = PCRE2_ERROR_INTERNAL ,
  match_error_codes::JITStackLimit = PCRE2_ERROR_JIT_STACKLIMIT , match_error_codes::MatchLimit = PCRE2_ERROR_MATCHLIMIT , match_error_codes::NoMemory = PCRE2_ERROR_NOMEMORY , match_error_codes::Null = PCRE2_ERROR_NULL ,
  match_error_codes::RecurseLoop = PCRE2_ERROR_RECURSELOOP
}
 Error codes which can be returned when match fail (now not used but maybe in future). More...
enum class  match_options_bits : uint32_t {
  match_options_bits::None = 0u , match_options_bits::Anchored = PCRE2_ANCHORED , match_options_bits::CopyMatchedSubject = PCRE2_COPY_MATCHED_SUBJECT , match_options_bits::DisableRecurseLoopCheck = PCRE2_DISABLE_RECURSELOOP_CHECK ,
  match_options_bits::EndAnchored = PCRE2_ENDANCHORED , match_options_bits::NotBOL = PCRE2_NOTBOL , match_options_bits::NotEOL = PCRE2_NOTEOL , match_options_bits::NotEmpty = PCRE2_NOTEMPTY ,
  match_options_bits::NotEmptyAtStart = PCRE2_NOTEMPTY_ATSTART , match_options_bits::NoJIT = PCRE2_NO_JIT , match_options_bits::NoUTFCheck = PCRE2_NO_UTF_CHECK , match_options_bits::PartialHard = PCRE2_PARTIAL_HARD ,
  match_options_bits::PartialSoft = PCRE2_PARTIAL_SOFT
}
 Match options. More...
enum class  compile_options_bits : uint32_t {
  compile_options_bits::None = 0u , compile_options_bits::Anchored = PCRE2_ANCHORED , compile_options_bits::AllowEmptyClass = PCRE2_ALLOW_EMPTY_CLASS , compile_options_bits::AltBSUX = PCRE2_ALT_BSUX ,
  compile_options_bits::AltCircumflex = PCRE2_ALT_CIRCUMFLEX , compile_options_bits::AltVerbNames = PCRE2_ALT_VERBNAMES , compile_options_bits::AutoCallout = PCRE2_AUTO_CALLOUT , compile_options_bits::Caseless = PCRE2_CASELESS ,
  compile_options_bits::DollarEndonly = PCRE2_DOLLAR_ENDONLY , compile_options_bits::DotAll = PCRE2_DOTALL , compile_options_bits::DupNames = PCRE2_DUPNAMES , compile_options_bits::EndAnchored = PCRE2_ENDANCHORED ,
  compile_options_bits::Extended = PCRE2_EXTENDED , compile_options_bits::FirstLine = PCRE2_FIRSTLINE , compile_options_bits::Literal = PCRE2_LITERAL , compile_options_bits::MatchInvalidUTF = PCRE2_MATCH_INVALID_UTF ,
  compile_options_bits::MatchUnsetBackRef = PCRE2_MATCH_UNSET_BACKREF , compile_options_bits::Multiline = PCRE2_MULTILINE , compile_options_bits::NeverBackslashC = PCRE2_NEVER_BACKSLASH_C , compile_options_bits::NeverUCP = PCRE2_NEVER_UCP ,
  compile_options_bits::NeverUTF = PCRE2_NEVER_UTF , compile_options_bits::NoAutoCapture = PCRE2_NO_AUTO_CAPTURE , compile_options_bits::NoAutoPossess = PCRE2_NO_AUTO_POSSESS , compile_options_bits::NoDotStarAnchor = PCRE2_NO_DOTSTAR_ANCHOR ,
  compile_options_bits::NoStartOptimize = PCRE2_NO_START_OPTIMIZE , compile_options_bits::NoUTFCheck = PCRE2_NO_UTF_CHECK , compile_options_bits::UCP = PCRE2_UCP , compile_options_bits::UnGreedy = PCRE2_UNGREEDY ,
  compile_options_bits::UseOffsetLimit = PCRE2_USE_OFFSET_LIMIT , compile_options_bits::UTF = PCRE2_UTF
}
 Compile options. More...
enum class  utf_type : uint8_t { utf_type::UTF_8 = 8 , utf_type::UTF_16 = 16 , utf_type::UTF_32 = 32 }
 Enum with supported utf types. More...

Functions

template<utf_type utf>
static _PCRE2CPP_CONSTEXPR17 utils::pcre2_data< utf >::string_type generate_error_message (const int error_code) noexcept
 Function which generate error message based on pcre2 error code.
template<utf_type utf>
static _PCRE2CPP_CONSTEXPR17 utils::pcre2_data< utf >::string_type generate_error_message (const int error_code, const size_t error_offset) noexcept
 Function which generates error message based on pcre2 error code and with additional information about offset.
template<utf_type utf>
static _PCRE2CPP_CONSTEXPR20 std::string convert_any_utf_to_utf8 (const typename utils::pcre2_data< utf >::string_view_type message) noexcept
 converts any message from any utf to utf-8
static _PCRE2CPP_CONSTEXPR17 match_options operator| (const match_options_bits opt0, const match_options_bits opt1) noexcept
 operator for combining match options to one flags group
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
template<utf_type utf = default_utf_type>
bool is_pattern_valid (const typename utils::pcre2_data< utf >::string_view_type pattern, const compile_options opts=compile_options_bits::None) noexcept

Variables

static constexpr auto default_utf_type
 default utf type for types like regex etc...

Detailed Description

Main namespace of pcre2cpp library.

Typedef Documentation

◆ match_result

◆ match_result_exception

◆ match_value

◆ pcre2cpp_exception

◆ regex

◆ regex_exception

◆ u16match_result

◆ u16match_result_exception

◆ u16match_value

◆ u16pcre2cpp_exception

◆ u16regex

◆ u16regex_exception

◆ u32match_result

◆ u32match_result_exception

◆ u32match_value

◆ u32pcre2cpp_exception

◆ u32regex

◆ u32regex_exception

◆ u8match_result

◆ u8match_result_exception

◆ u8match_value

◆ u8pcre2cpp_exception

◆ u8regex

◆ u8regex_exception

Function Documentation

◆ is_pattern_valid()

template<utf_type utf = default_utf_type>
bool pcre2cpp::is_pattern_valid ( const typename utils::pcre2_data< utf >::string_view_type pattern,
const compile_options opts = compile_options_bits::None )
noexcept

◆ operator|()

_PCRE2CPP_CONSTEXPR17 compile_options pcre2cpp::operator| ( const compile_options_bits opt0,
const compile_options_bits opt1 )
staticnoexcept

operator for combining compile options to one flags group

Parameters
opt0first compile option
opt1second compile option
Returns
Compile options flags group created from two compile options