PCRE2 C++ Wrapper 1.2.4
pcre2cpp
Loading...
Searching...
No Matches
pcre2cpp::basic_regex< utf > Class Template Reference

Basic PCRE2 Regex container. More...

#include <pcre2cpp.hpp>

Inheritance diagram for pcre2cpp::basic_regex< utf >:
[legend]

Public Member Functions

_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
_PCRE2CPP_CONSTEXPR17 basic_regex (const basic_regex &other) noexcept=default
 default copy constructor
_PCRE2CPP_CONSTEXPR17 basic_regex (basic_regex &&other) noexcept=default
 default move constructor
_PCRE2CPP_CONSTEXPR20 ~basic_regex () noexcept=default
 default destructor
_PCRE2CPP_CONSTEXPR17 basic_regexoperator= (const basic_regex &other) noexcept=default
 default copy assign operator
_PCRE2CPP_CONSTEXPR17 basic_regexoperator= (basic_regex &&other) noexcept=default
 default move assign operator
_PCRE2CPP_CONSTEXPR17 bool is_initialized () const noexcept
 returns true if regex was initialized
_PCRE2CPP_CONSTEXPR17 _string_type get_error_message () const noexcept
 returns error message if there is any compilation error
_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
_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
_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
_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 variable
_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

Detailed Description

template<utf_type utf>
class pcre2cpp::basic_regex< utf >

Basic PCRE2 Regex container.

Template Parameters
utfUTF type

Constructor & Destructor Documentation

◆ basic_regex() [1/3]

template<utf_type utf>
_PCRE2CPP_CONSTEXPR20 pcre2cpp::basic_regex< utf >::basic_regex ( const _string_view_type pattern,
const compile_options opts = compile_options_bits::None )
inlineexplicit

basic regex container with pattern and compile options

◆ basic_regex() [2/3]

template<utf_type utf>
_PCRE2CPP_CONSTEXPR17 pcre2cpp::basic_regex< utf >::basic_regex ( const basic_regex< utf > & other)
defaultnoexcept

default copy constructor

◆ basic_regex() [3/3]

template<utf_type utf>
_PCRE2CPP_CONSTEXPR17 pcre2cpp::basic_regex< utf >::basic_regex ( basic_regex< utf > && other)
defaultnoexcept

default move constructor

◆ ~basic_regex()

template<utf_type utf>
_PCRE2CPP_CONSTEXPR20 pcre2cpp::basic_regex< utf >::~basic_regex ( )
defaultnoexcept

default destructor

Member Function Documentation

◆ get_error_message()

template<utf_type utf>
_PCRE2CPP_CONSTEXPR17 _string_type pcre2cpp::basic_regex< utf >::get_error_message ( ) const
inlinenoexcept

returns error message if there is any compilation error

◆ is_initialized()

template<utf_type utf>
_PCRE2CPP_CONSTEXPR17 bool pcre2cpp::basic_regex< utf >::is_initialized ( ) const
inlinenoexcept

returns true if regex was initialized

◆ match() [1/2]

template<utf_type utf>
_PCRE2CPP_CONSTEXPR20 bool pcre2cpp::basic_regex< utf >::match ( const _string_view_type text,
_match_result_type & result,
const size_t offset = 0,
const match_options opts = match_options_bits::None ) const
inlinenoexcept

returns true if match was found and result is stored in result variable

◆ match() [2/2]

template<utf_type utf>
_PCRE2CPP_CONSTEXPR17 bool pcre2cpp::basic_regex< utf >::match ( const _string_view_type text,
const size_t offset = 0,
const match_options opts = match_options_bits::None ) const
inline

returns true if match was found

◆ match_all()

template<utf_type utf>
_PCRE2CPP_CONSTEXPR17 bool pcre2cpp::basic_regex< utf >::match_all ( const _string_view_type text,
std::vector< _match_result_type > & results,
size_t offset = 0 ) const
inlinenoexcept

returns true if any match was found and all results store in results array

◆ match_at() [1/2]

template<utf_type utf>
_PCRE2CPP_CONSTEXPR17 bool pcre2cpp::basic_regex< utf >::match_at ( const _string_view_type text,
_match_result_type & result,
const size_t offset = 0 ) const
inlinenoexcept

returns true if match was found, and it has relative offset == 0 and result is stored in result variable

◆ match_at() [2/2]

template<utf_type utf>
_PCRE2CPP_CONSTEXPR17 bool pcre2cpp::basic_regex< utf >::match_at ( const _string_view_type text,
const size_t offset = 0 ) const
inlinenoexcept

returns true if match was found, and it has relative offset == 0

◆ operator=() [1/2]

template<utf_type utf>
_PCRE2CPP_CONSTEXPR17 basic_regex & pcre2cpp::basic_regex< utf >::operator= ( basic_regex< utf > && other)
defaultnoexcept

default move assign operator

◆ operator=() [2/2]

template<utf_type utf>
_PCRE2CPP_CONSTEXPR17 basic_regex & pcre2cpp::basic_regex< utf >::operator= ( const basic_regex< utf > & other)
defaultnoexcept

default copy assign operator


The documentation for this class was generated from the following file: