<!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>Parle pattern matching</title> </head> <body><div class="manualnavbar" style="text-align: center;"> <div class="prev" style="text-align: left; float: left;"><a href="parle.constants.html">Predefined Constants</a></div> <div class="next" style="text-align: right; float: right;"><a href="parle.regex.chars.html">Character representations</a></div> <div class="up"><a href="book.parle.html">Parle</a></div> <div class="home"><a href="index.html">PHP Manual</a></div> </div><hr /><div id="parle.pattern.matching" class="chapter"> <h1>Parle pattern matching</h1> <h2>Table of Contents</h2><ul class="chunklist chunklist_chapter"><li><a href="parle.regex.chars.html">Character representations</a></li><li><a href="parle.regex.charclass.html">Character classes</a></li><li><a href="parle.regex.unicodecharclass.html">Unicode character classes</a></li><li><a href="parle.regex.alternation.html">Alternation and repetition</a></li><li><a href="parle.regex.anchors.html">Anchors</a></li><li><a href="parle.regex.grouping.html">Grouping</a></li></ul> <p class="para"> Parle supports regex matching similar to flex. Also supported are the following POSIX character sets: <em>[:alnum:]</em>, <em>[:alpha:]</em>, <em>[:blank:]</em>, <em>[:cntrl:]</em>, <em>[:digit:]</em>, <em>[:graph:]</em>, <em>[:lower:]</em>, <em>[:print:]</em>, <em>[:punct:]</em>, <em>[:space:]</em>, <em>[:upper:]</em> and <em>[:xdigit:]</em>. </p> <p class="para"> The Unicode character classes are currently not enabled by default, pass --enable-parle-utf32 to make them available. A particular encoding can be mapped with a correctly constructed regex. For example, to match the EURO symbol encoded in UTF-8, the regular expression <em>[\xe2][\x82][\xac]</em> can be used. The pattern for an UTF-8 encoded string could be <em>[ -\x7f]{+}[\x80-\xbf]{+}[\xc2-\xdf]{+}[\xe0-\xef]{+}[\xf0-\xff]+</em>. </p> </div> <hr /><div class="manualnavbar" style="text-align: center;"> <div class="prev" style="text-align: left; float: left;"><a href="parle.constants.html">Predefined Constants</a></div> <div class="next" style="text-align: right; float: right;"><a href="parle.regex.chars.html">Character representations</a></div> <div class="up"><a href="book.parle.html">Parle</a></div> <div class="home"><a href="index.html">PHP Manual</a></div> </div></body></html>