1 .TH PCRE2_PATTERN_CONVERT 3 "11 July 2017" "PCRE2 10.30"
3 PCRE2 - Perl-compatible regular expressions (revised API)
10 .B int pcre2_pattern_convert(PCRE2_SPTR \fIpattern\fP, PCRE2_SIZE \fIlength\fP,
11 .B " uint32_t \fIoptions\fP, PCRE2_UCHAR **\fIbuffer\fP,"
12 .B " PCRE2_SIZE *\fIblength\fP, pcre2_convert_context *\fIcvcontext\fP);"
18 This function is part of an experimental set of pattern conversion functions.
19 It converts a foreign pattern (for example, a glob) into a PCRE2 regular
20 expression pattern. Its arguments are:
22 \fIpattern\fP The foreign pattern
23 \fIlength\fP The length of the input pattern or PCRE2_ZERO_TERMINATED
24 \fIoptions\fP Option bits
25 \fIbuffer\fP Pointer to pointer to output buffer, or NULL
26 \fIblength\fP Pointer to output length field
27 \fIcvcontext\fP Pointer to a convert context or NULL
29 The length of the converted pattern (excluding the terminating zero) is
30 returned via \fIblength\fP. If \fIbuffer\fP is NULL, the function just returns
31 the output length. If \fIbuffer\fP points to a NULL pointer, heap memory is
32 obtained for the converted pattern, using the allocator in the context if
33 present (or else \fBmalloc()\fP), and the field pointed to by \fIbuffer\fP is
34 updated. If \fIbuffer\fP points to a non-NULL field, that must point to a
35 buffer whose size is in the variable pointed to by \fIblength\fP. This value is
40 PCRE2_CONVERT_UTF Input is UTF
41 PCRE2_CONVERT_NO_UTF_CHECK Do not check UTF validity
42 PCRE2_CONVERT_POSIX_BASIC Convert POSIX basic pattern
43 PCRE2_CONVERT_POSIX_EXTENDED Convert POSIX extended pattern
44 PCRE2_CONVERT_GLOB ) Convert
45 PCRE2_CONVERT_GLOB_NO_WILD_SEPARATOR ) various types
46 PCRE2_CONVERT_GLOB_NO_STARSTAR ) of glob
48 The return value from \fBpcre2_pattern_convert()\fP is zero on success or a
49 non-zero PCRE2 error code.
51 The pattern conversion functions are described in the