Home | History | Annotate | Download | only in html
      1 <html>
      2 <head>
      3 <title>pcre2_pattern_convert specification</title>
      4 </head>
      5 <body bgcolor="#FFFFFF" text="#00005A" link="#0066FF" alink="#3399FF" vlink="#2222BB">
      6 <h1>pcre2_pattern_convert man page</h1>
      7 <p>
      8 Return to the <a href="index.html">PCRE2 index page</a>.
      9 </p>
     10 <p>
     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.
     14 <br>
     15 <br><b>
     16 SYNOPSIS
     17 </b><br>
     18 <P>
     19 <b>#include &#60;pcre2.h&#62;</b>
     20 </P>
     21 <P>
     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>
     25 </P>
     26 <br><b>
     27 DESCRIPTION
     28 </b><br>
     29 <P>
     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:
     33 <pre>
     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
     40 </pre>
     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
     48 updated.
     49 </P>
     50 <P>
     51 The option bits are:
     52 <pre>
     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
     60 </pre>
     61 The return value from <b>pcre2_pattern_convert()</b> is zero on success or a
     62 non-zero PCRE2 error code.
     63 </P>
     64 <P>
     65 The pattern conversion functions are described in the
     66 <a href="pcre2convert.html"><b>pcre2convert</b></a>
     67 documentation.
     68 <p>
     69 Return to the <a href="index.html">PCRE2 index page</a>.
     70 </p>
     71