3 <title>pcre2_pattern_convert specification</title>
5 <body bgcolor="#FFFFFF" text="#00005A" link="#0066FF" alink="#3399FF" vlink="#2222BB">
6 <h1>pcre2_pattern_convert man page</h1>
8 Return to the <a href="index.html">PCRE2 index page</a>.
11 This page is part of the PCRE2 HTML documentation. It was generated
12 automatically from the original man page. If there is any nonsense in it,
13 please consult the man page, in case the conversion went wrong.
19 <b>#include <pcre2.h></b>
22 <b>int pcre2_pattern_convert(PCRE2_SPTR <i>pattern</i>, PCRE2_SIZE <i>length</i>,</b>
23 <b> uint32_t <i>options</i>, PCRE2_UCHAR **<i>buffer</i>,</b>
24 <b> PCRE2_SIZE *<i>blength</i>, pcre2_convert_context *<i>cvcontext</i>);</b>
30 This function is part of an experimental set of pattern conversion functions.
31 It converts a foreign pattern (for example, a glob) into a PCRE2 regular
32 expression pattern. Its arguments are:
34 <i>pattern</i> The foreign pattern
35 <i>length</i> The length of the input pattern or PCRE2_ZERO_TERMINATED
36 <i>options</i> Option bits
37 <i>buffer</i> Pointer to pointer to output buffer, or NULL
38 <i>blength</i> Pointer to output length field
39 <i>cvcontext</i> Pointer to a convert context or NULL
41 The length of the converted pattern (excluding the terminating zero) is
42 returned via <i>blength</i>. If <i>buffer</i> is NULL, the function just returns
43 the output length. If <i>buffer</i> points to a NULL pointer, heap memory is
44 obtained for the converted pattern, using the allocator in the context if
45 present (or else <b>malloc()</b>), and the field pointed to by <i>buffer</i> is
46 updated. If <i>buffer</i> points to a non-NULL field, that must point to a
47 buffer whose size is in the variable pointed to by <i>blength</i>. This value is
53 PCRE2_CONVERT_UTF Input is UTF
54 PCRE2_CONVERT_NO_UTF_CHECK Do not check UTF validity
55 PCRE2_CONVERT_POSIX_BASIC Convert POSIX basic pattern
56 PCRE2_CONVERT_POSIX_EXTENDED Convert POSIX extended pattern
57 PCRE2_CONVERT_GLOB ) Convert
58 PCRE2_CONVERT_GLOB_NO_WILD_SEPARATOR ) various types
59 PCRE2_CONVERT_GLOB_NO_STARSTAR ) of glob
61 The return value from <b>pcre2_pattern_convert()</b> is zero on success or a
62 non-zero PCRE2 error code.
65 The pattern conversion functions are described in the
66 <a href="pcre2convert.html"><b>pcre2convert</b></a>
69 Return to the <a href="index.html">PCRE2 index page</a>.