PCRE2_PATTERN_CONVERT(3)
π PCRE2_PATTERN_CONVERT(3) π
okay bestie, welcome to the Library Functions Manual page for PCRE2_PATTERN_CONVERT(3) β yes, the manual name is folded in right here instead of being a whole copied header line, we're cute like that π
. This one is about the pattern conversion function, and it's giving experimental energy (more on that in a sec).
β¨ NAME β¨
PCRE2 - Perl-compatible regular expressions (revised API). π
π¦ SYNOPSIS π¦
#include <pcre2.h>
int pcre2_pattern_convert(PCRE2_SPTR pattern, PCRE2_SIZE length,
uint32_t options, PCRE2_UCHAR **buffer,
PCRE2_SIZE *blength, pcre2_convert_context *cvcontext);
πΈ 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. iconic.
π Its arguments, bestie π
patternβ The foreign patternlengthβ The length of the input pattern orPCRE2_ZERO_TERMINATEDoptionsβ Option bitsbufferβ Pointer to pointer to output buffer, orNULLblengthβ Pointer to output length fieldcvcontextβ Pointer to a convert context orNULL
The length of the converted pattern (excluding the terminating zero) is returned via blength. If buffer is NULL, the function just returns the output length. If buffer 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 buffer is updated. If buffer points to a non-NULL field, that must point to a buffer whose size is in the variable pointed to by blength. This value is updated. β¨
π Option bits π
The option bits are:
PCRE2_CONVERT_UTFβ Input is UTFPCRE2_CONVERT_NO_UTF_CHECKβ Do not check UTF validityPCRE2_CONVERT_POSIX_BASICβ Convert POSIX basic patternPCRE2_CONVERT_POSIX_EXTENDEDβ Convert POSIX extended patternPCRE2_CONVERT_GLOBβ)ConvertPCRE2_CONVERT_GLOB_NO_WILD_SEPARATORβ)various typesPCRE2_CONVERT_GLOB_NO_STARSTARβ)of glob
okay so the last three are grouped in the original with those)markers β the full grouped bit reads Convert various types of glob. Not me lowkey loving that the manpage keeps its little)grouping vibe intact π«Ά. iykyk.
π Return value π
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.
xoxo, your Unix bestie π«Ά β that was PCRE2_PATTERN_CONVERT(3), from PCRE2 10.47, dated 12 July 2017. mwah πβ¨
π¦ where this page comes from
- fedora 43: pcre2-devel 10.47-1.fc43 Β· BSD-3-Clause AND FSFULLR AND X11 AND GPL-2.0-or-later AND FSFAP AND FSFUL AND GPL-3.0-or-later
- fedora 43: pcre2-devel 10.47-1.fc43 Β· BSD-3-Clause AND FSFULLR AND X11 AND GPL-2.0-or-later AND FSFAP AND FSFUL AND GPL-3.0-or-later
- fedora 44: pcre2-devel 10.47-1.fc44.1 Β· BSD-3-Clause AND FSFULLR AND X11 AND GPL-2.0-or-later AND FSFAP AND FSFUL AND GPL-3.0-or-later
- fedora 44: pcre2-devel 10.47-1.fc44.1 Β· BSD-3-Clause AND FSFULLR AND X11 AND GPL-2.0-or-later AND FSFAP AND FSFUL AND GPL-3.0-or-later
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash-1017 on : a language model's rewrite of the original, under its terms