Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    text
    copied!<p>You can use <a href="http://www.pcre.org/" rel="nofollow noreferrer">PCRE</a>:</p> <blockquote> <p>The PCRE library is a set of functions that implement regular expression pattern matching using the same syntax and semantics as Perl 5. PCRE has its own native API, as well as a set of wrapper functions that correspond to the POSIX regular expression API. The PCRE library is free, even for building commercial software.</p> </blockquote> <p>See <a href="http://www.pcre.org/original/doc/html/pcredemo.html" rel="nofollow noreferrer">pcredemo.c</a> for a PCRE example.</p> <p>If you cannot use PCRE, <a href="http://www.opengroup.org/onlinepubs/009695399/basedefs/xbd_chap09.html" rel="nofollow noreferrer">POSIX regular expression</a> support is probably available on your system (<a href="https://stackoverflow.com/questions/1631450/how-can-use-regular-expressions-in-c/1631569#1631569">as @tinkertim pointed out</a>). For Windows, you can use the <a href="http://gnuwin32.sourceforge.net/packages/regex.htm" rel="nofollow noreferrer">gnuwin Regex for Windows package</a>.</p> <p>The <a href="http://www.opengroup.org/onlinepubs/009695399/functions/regcomp.html" rel="nofollow noreferrer"><code>regcomp</code></a> documentation includes the following example:</p> <pre><code>#include &lt;regex.h&gt; /* * Match string against the extended regular expression in * pattern, treating errors as no match. * * Return 1 for match, 0 for no match. */ int match(const char *string, char *pattern) { int status; regex_t re; if (regcomp(&amp;re, pattern, REG_EXTENDED|REG_NOSUB) != 0) { return(0); /* Report error. */ } status = regexec(&amp;re, string, (size_t) 0, NULL, 0); regfree(&amp;re); if (status != 0) { return(0); /* Report error. */ } return(1); } </code></pre>
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload