PCRE2 – Perl-compatible regular expressions (revised API)
Synopsis
#include <pcre2.h>
int pcre2_pattern_info(const pcre2_code *code, uint32_t what,
void *where);
Description
This function returns information about a compiled pattern. Its arguments are:
code Pointer to a compiled regular expression pattern
what What information is required
where Where to put the information The recognized values for the what argument, and the information they request are as follows: If where is NULL, the function returns the amount of memory needed for the requested information, in bytes. Otherwise, the where argument must point to an unsigned 32-bit integer (uint32_t variable), except for the following what values, when it must point to a variable of the type shown:
PCRE2_INFO_FIRSTBITMAP const uint8_t *
PCRE2_INFO_JITSIZE size_t
PCRE2_INFO_NAMETABLE PCRE2_SPTR
PCRE2_INFO_SIZE size_t The yield of the function is zero on success or:
PCRE2_ERROR_NULL the argument code is NULL
PCRE2_ERROR_BADMAGIC the "magic number" was not found
PCRE2_ERROR_BADOPTION the value of what is invalid
PCRE2_ERROR_BADMODE the pattern was compiled in the wrong mode
PCRE2_ERROR_UNSET the requested information is not set There is a complete description of the PCRE2 native API in the pcre2api page and a description of the POSIX API in the pcre2posix page.