pcre2_pattern_convert
Name
pcre2_pattern_convert - foreign pattern converter
Synopsis
#include <pcre2.h>
int pcre2_pattern_convert(PCRE2_SPTR pattern, PCRE2_SIZE plength,
uint32_t options, PCRE2_UCHAR **buffptr,
PCRE2_SIZE *bufflenptr,
pcre2_convert_context *ccontext);Description
This function is part of an experimental set of pattern conversion functions. It converts a foreign pattern (for example, a glob) into a PCRE2 regular expression pattern. Its arguments are:
patternThe foreign pattern
plengthThe length of the input pattern or
PCRE2_ZERO_TERMINATEDoptionsOption bits
buffptrPointer to pointer to output buffer, or
NULLbufflenptrPointer to output length field
ccontextPointer to a convert context or
NULL
The length of the converted pattern (excluding the terminating zero) is
returned via bufflenptr. If buffptr is NULL, the function just returns
the output length. If buffptr points to a NULL pointer, heap memory is
obtained for the converted pattern, using the allocator in the context if
present (or else malloc()), and the field pointed to by buffptr is
updated. If buffptr points to a non-NULL field, that must point to a
buffer whose size is in the variable pointed to by bufflenptr. This value is
updated.
The option bits are:
The return value from pcre2_pattern_convert() is zero on success or a
non-zero PCRE2 error code.
The pattern conversion functions are described in the
pcre2convert
documentation.