|
PCRE2 C++ Wrapper 1.3.0
pcre2cpp
|
Main group. More...
Topics | |
| Utilities | |
| group with utilities (not for end user to use) | |
Classes | |
| class | pcre2cpp::basic_pcre2cpp_exception< utf > |
| base pcre2cpp exception class More... | |
| class | pcre2cpp::basic_regex_exception< utf > |
| regex exception class More... | |
| class | pcre2cpp::basic_match_result_exception< utf > |
| match result exception class More... | |
| struct | pcre2cpp::basic_match_value< utf > |
| Match value container. More... | |
| struct | pcre2cpp::sub_match_value |
| Sub match value container. More... | |
| class | pcre2cpp::basic_match_result< utf > |
| Basic container to result data of match function. More... | |
| class | pcre2cpp::basic_regex< utf > |
| Basic PCRE2 Regex container. More... | |
Macros | |
| #define | PCRE2CPP_VERSION_MAJOR 1 |
| pcre2cpp version major number | |
| #define | PCRE2CPP_VERSION_MINOR 3 |
| pcre2cpp version minor number | |
| #define | PCRE2CPP_VERSION_PATCH 0 |
| pcre2cpp version patch number | |
| #define | PCRE2CPP_VERSION_STRING _PCRE2CPP_VERSION_TO_STRING(PCRE2CPP_VERSION_MAJOR, PCRE2CPP_VERSION_MINOR, PCRE2CPP_VERSION_PATCH) |
| pcre2cpp version string | |
| #define | PCRE2CPP_VERSION_INT _PCRE2CPP_VERSION_TO_INT(PCRE2CPP_VERSION_MAJOR, PCRE2CPP_VERSION_MINOR, PCRE2CPP_VERSION_PATCH) |
| pcre2cpp version int | |
| #define | PCRE2CPP_VERSION PCRE2CPP_VERSION_STRING |
| pcre2cpp version string | |
| #define | PCRE2CPP_LAST_UPDATE_DAY 19 |
| pcre2cpp last update day | |
| #define | PCRE2CPP_LAST_UPDATE_MONTH 05 |
| pcre2cpp last update month | |
| #define | PCRE2CPP_LAST_UPDATE_YEAR 2026 |
| pcre2cpp last update year | |
| #define | PCRE2CPP_LAST_UPDATE_DATE _PCRE2CPP_LAST_UPDATE_DATE_HELPER(PCRE2CPP_LAST_UPDATE_DAY, PCRE2CPP_LAST_UPDATE_MONTH, PCRE2CPP_LAST_UPDATE_YEAR) |
| pcre2cpp last update date string | |
Typedefs | |
| using | pcre2cpp::match_options = mstd::flags<match_options_bits> |
| Match options flags group. | |
| using | pcre2cpp::compile_options = mstd::flags<compile_options_bits> |
| Compile options flags group. | |
Functions | |
| template<utf_type utf> | |
| static _PCRE2CPP_CONSTEXPR17 utils::pcre2_data< utf >::string_type | pcre2cpp::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 | pcre2cpp::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 | pcre2cpp::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 | pcre2cpp::operator| (const match_options_bits opt0, const match_options_bits opt1) noexcept |
| operator for combining match options to one flags group | |
Variables | |
| static constexpr auto | pcre2cpp::default_utf_type |
| default utf type for types like regex etc... | |
Main group.
| #define PCRE2CPP_LAST_UPDATE_DATE _PCRE2CPP_LAST_UPDATE_DATE_HELPER(PCRE2CPP_LAST_UPDATE_DAY, PCRE2CPP_LAST_UPDATE_MONTH, PCRE2CPP_LAST_UPDATE_YEAR) |
pcre2cpp last update date string
| #define PCRE2CPP_LAST_UPDATE_DAY 19 |
pcre2cpp last update day
| #define PCRE2CPP_LAST_UPDATE_MONTH 05 |
pcre2cpp last update month
| #define PCRE2CPP_LAST_UPDATE_YEAR 2026 |
pcre2cpp last update year
| #define PCRE2CPP_VERSION PCRE2CPP_VERSION_STRING |
pcre2cpp version string
| #define PCRE2CPP_VERSION_INT _PCRE2CPP_VERSION_TO_INT(PCRE2CPP_VERSION_MAJOR, PCRE2CPP_VERSION_MINOR, PCRE2CPP_VERSION_PATCH) |
pcre2cpp version int
| #define PCRE2CPP_VERSION_MAJOR 1 |
pcre2cpp version major number
| #define PCRE2CPP_VERSION_MINOR 3 |
pcre2cpp version minor number
| #define PCRE2CPP_VERSION_PATCH 0 |
pcre2cpp version patch number
| #define PCRE2CPP_VERSION_STRING _PCRE2CPP_VERSION_TO_STRING(PCRE2CPP_VERSION_MAJOR, PCRE2CPP_VERSION_MINOR, PCRE2CPP_VERSION_PATCH) |
pcre2cpp version string
| using pcre2cpp::compile_options = mstd::flags<compile_options_bits> |
Compile options flags group.
| using pcre2cpp::match_options = mstd::flags<match_options_bits> |
Match options flags group.
|
strong |
Compile options.
|
strong |
Error codes which can be returned when match fail (now not used but maybe in future).
| Enumerator | ||
|---|---|---|
| None | 1 | No error (default). |
| NoMatch | PCRE2_ERROR_NOMATCH | The subject string did not match the pattern. |
| Partial | PCRE2_ERROR_PARTIAL | The subject string did not match, but it did match partially. |
| BadMagic | PCRE2_ERROR_BADMAGIC | PCRE2 stores a 4-byte "magic number" at the start of the compiled code, to catch the case when it is passed a junk pointer. This is the error that is returned when the magic number is not present |
| BadMode | PCRE2_ERROR_BADMODE | This error is given when a compiled pattern is passed to a function in a library of a different code unit width, for example, a pattern compiled by the 8-bit library is passed to a 16-bit or 32-bit library function. |
| BadOffset | PCRE2_ERROR_BADOFFSET | The value of startoffset was greater than the length of the subject. |
| BadOption | PCRE2_ERROR_BADOPTION | An unrecognized bit was set in the options argument. |
| BadUTFOffset | PCRE2_ERROR_BADUTFOFFSET | The UTF code unit sequence that was passed as a subject was checked and found to be valid (the match_option::NoUTFCheck option was not set), but the value of startoffset did not point to the beginning of a UTF character or the end of the subject. |
| Callout | PCRE2_ERROR_CALLOUT | This error is never generated by pcre2_match() itself. It is provided for use by callout functions that want to cause pcre2_match() or pcre2_callout_enumerate() to return a distinctive error code. |
| DepthLimit | PCRE2_ERROR_DEPTHLIMIT | The nested backtracking depth limit was reached. |
| HeapLimit | PCRE2_ERROR_HEAPLIMIT | The heap limit was reached. |
| Internal | PCRE2_ERROR_INTERNAL | An unexpected internal error has occurred. This error could be caused by a bug in PCRE2 or by overwriting of the compiled pattern. |
| JITStackLimit | PCRE2_ERROR_JIT_STACKLIMIT | This error is returned when a pattern that was successfully studied using JIT is being matched, but the memory available for the just-in-time processing stack is not large enough. |
| MatchLimit | PCRE2_ERROR_MATCHLIMIT | The backtracking match limit was reached. |
| NoMemory | PCRE2_ERROR_NOMEMORY | Heap memory is used to remember backtracking points. This error is given when the memory allocation function (default or custom) fails. Note that a different error, PCRE2_ERROR_HEAPLIMIT, is given if the amount of memory needed exceeds the heap limit. match_error_codes::NoMemory is also returned if match_options_bits::CopyMatchedSubject is set and memory allocation fails. |
| Null | PCRE2_ERROR_NULL | Either the code, subject, or match_data argument was passed as nullptr. |
| RecurseLoop | PCRE2_ERROR_RECURSELOOP | This error is returned when pcre2_match() detects a recursion loop within the pattern. Specifically, it means that either the whole pattern or a capture group has been called recursively for the second time at the same position in the subject string. Some simple patterns that might do this are detected and faulted at compile time, but more complicated cases, in particular mutual recursions between two different groups, cannot be detected until matching is attempted. |
|
strong |
Match options.
| Enumerator | ||
|---|---|---|
| None | 0u | No options set (default). |
| Anchored | PCRE2_ANCHORED | Match only at the first position. |
| CopyMatchedSubject | PCRE2_COPY_MATCHED_SUBJECT | On success, make a private subject copy. |
| DisableRecurseLoopCheck | PCRE2_DISABLE_RECURSELOOP_CHECK | Only useful in rare cases; use with care. |
| EndAnchored | PCRE2_ENDANCHORED | Pattern can match only at end of subject. |
| NotBOL | PCRE2_NOTBOL | Subject string is not the beginning of a line. |
| NotEOL | PCRE2_NOTEOL | Subject string is not the end of a line. |
| NotEmpty | PCRE2_NOTEMPTY | An empty string is not a valid match. |
| NotEmptyAtStart | PCRE2_NOTEMPTY_ATSTART | An empty string at the start of the subject is not a valid match. |
| NoJIT | PCRE2_NO_JIT | Do not use JIT matching. |
| NoUTFCheck | PCRE2_NO_UTF_CHECK | Do not check the subject for UTF validity(only relevant if compile_options::UTF was set at compile time). |
| PartialHard | PCRE2_PARTIAL_HARD | Return match_error_codes::Partial for a partial match even if there is a full match. |
| PartialSoft | PCRE2_PARTIAL_SOFT | Return match_error_codes::Partial for a partial match if no full matches are found. |
|
strong |
|
staticnoexcept |
converts any message from any utf to utf-8
| utf | UTF type |
| message | message to convert |
|
staticnoexcept |
Function which generate error message based on pcre2 error code.
| utf | UTF type |
| error_code | pcre2 error code |
|
staticnoexcept |
Function which generates error message based on pcre2 error code and with additional information about offset.
| utf | UTF type |
| error_code | pcre2 error code |
| error_offset | offset for example in regex pattern |
|
staticnoexcept |
operator for combining match options to one flags group
| opt0 | first match option |
| opt1 | second match option |
|
staticconstexpr |
default utf type for types like regex etc...