<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd"> <html> <head> <meta http-equiv="content-type" content="text/html; charset=UTF-8"> <title>Introduction</title> </head> <body><div class="manualnavbar" style="text-align: center;"> <div class="prev" style="text-align: left; float: left;"><a href="book.pcre.html">PCRE</a></div> <div class="next" style="text-align: right; float: right;"><a href="pcre.setup.html">Installing/Configuring</a></div> <div class="up"><a href="book.pcre.html">PCRE</a></div> <div class="home"><a href="index.html">PHP Manual</a></div> </div><hr /><div id="intro.pcre" class="preface"> <h1 class="title">Introduction</h1> <p class="para"> The syntax for patterns used in these functions closely resembles Perl. The expression must be enclosed in the delimiters, a forward slash (/), for example. Delimiters can be any non-alphanumeric, non-whitespace ASCII character except the backslash (\) and the null byte. If the delimiter character has to be used in the expression itself, it needs to be escaped by backslash. Since PHP 4.0.4, you can also use Perl-style (), {}, [], and <> matching delimiters. See <a href="reference.pcre.pattern.syntax.html" class="link">Pattern Syntax</a> for detailed explanation. </p> <p class="para"> The ending delimiter may be followed by various modifiers that affect the matching. See <a href="reference.pcre.pattern.modifiers.html" class="link">Pattern Modifiers</a>. </p> <p class="para"> PHP also supports regular expressions using a POSIX-extended syntax using the <a href="book.regex.html" class="link">POSIX-extended regex functions</a>. </p> <blockquote class="note"><p><strong class="note">Note</strong>: <p class="para"> This extension maintains a global per-thread cache of compiled regular expressions (up to 4096). </p> </p></blockquote> <div class="warning"><strong class="warning">Warning</strong> <p class="para"> You should be aware of some limitations of PCRE. Read <a href="http://www.pcre.org/pcre.txt" class="link external">» http://www.pcre.org/pcre.txt</a> for more info. </p> </div> <p class="para"> The PCRE library is a set of functions that implement regular expression pattern matching using the same syntax and semantics as Perl 5, with just a few differences (see below). The current implementation corresponds to Perl 5.005. </p> </div><hr /><div class="manualnavbar" style="text-align: center;"> <div class="prev" style="text-align: left; float: left;"><a href="book.pcre.html">PCRE</a></div> <div class="next" style="text-align: right; float: right;"><a href="pcre.setup.html">Installing/Configuring</a></div> <div class="up"><a href="book.pcre.html">PCRE</a></div> <div class="home"><a href="index.html">PHP Manual</a></div> </div></body></html>