<!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>Make regular expression for case insensitive match</title> </head> <body><div class="manualnavbar" style="text-align: center;"> <div class="prev" style="text-align: left; float: left;"><a href="function.spliti.html">spliti</a></div> <div class="next" style="text-align: right; float: right;"><a href="book.ssdeep.html">ssdeep</a></div> <div class="up"><a href="ref.regex.html">POSIX Regex Functions</a></div> <div class="home"><a href="index.html">PHP Manual</a></div> </div><hr /><div id="function.sql-regcase" class="refentry"> <div class="refnamediv"> <h1 class="refname">sql_regcase</h1> <p class="verinfo">(PHP 4, PHP 5)</p><p class="refpurpose"><span class="refname">sql_regcase</span> — <span class="dc-title">Make regular expression for case insensitive match</span></p> </div> <div id="function.sql-regcase-refsynopsisdiv"> <div class="warning"><strong class="warning">Warning</strong> <p class="para"> This function was <em class="emphasis">DEPRECATED</em> in PHP 5.3.0, and <em class="emphasis">REMOVED</em> in PHP 7.0.0. </p> <p class="para"> Alternatives to this function include: </p> <ul class="simplelist"> <li class="member"><span class="function"><a href="function.preg-match.html" class="function">preg_match()</a></span></li> <li class="member"><span class="function"><a href="function.preg-quote.html" class="function">preg_quote()</a></span></li> </ul> </div> </div> <div class="refsect1 description" id="refsect1-function.sql-regcase-description"> <h3 class="title">Description</h3> <div class="methodsynopsis dc-description"> <span class="type">string</span> <span class="methodname"><strong>sql_regcase</strong></span> ( <span class="methodparam"><span class="type">string</span> <code class="parameter">$string</code></span> )</div> <p class="para rdfs-comment"> Creates a regular expression for a case insensitive match. </p> </div> <div class="refsect1 parameters" id="refsect1-function.sql-regcase-parameters"> <h3 class="title">Parameters</h3> <p class="para"> <dl> <dt> <code class="parameter">string</code></dt> <dd> <p class="para"> The input string. </p> </dd> </dl> </p> </div> <div class="refsect1 returnvalues" id="refsect1-function.sql-regcase-returnvalues"> <h3 class="title">Return Values</h3> <p class="para"> Returns a valid regular expression which will match <code class="parameter">string</code>, ignoring case. This expression is <code class="parameter">string</code> with each alphabetic character converted to a bracket expression; this bracket expression contains that character's uppercase and lowercase form. Other characters remain unchanged. </p> </div> <div class="refsect1 examples" id="refsect1-function.sql-regcase-examples"> <h3 class="title">Examples</h3> <p class="para"> <div class="example" id="example-6017"> <p><strong>Example #1 <span class="function"><strong>sql_regcase()</strong></span> example</strong></p> <div class="example-contents"> <div class="phpcode"><code><span style="color: #000000"> <span style="color: #0000BB"><?php<br /></span><span style="color: #007700">echo </span><span style="color: #0000BB">sql_regcase</span><span style="color: #007700">(</span><span style="color: #DD0000">"Foo - bar."</span><span style="color: #007700">);<br /></span><span style="color: #0000BB">?></span> </span> </code></div> </div> <div class="example-contents"><p>The above example will output:</p></div> <div class="example-contents screen"> <div class="cdata"><pre> [Ff][Oo][Oo] - [Bb][Aa][Rr]. </pre></div> </div> </div> </p> <p class="para"> This can be used to achieve case insensitive pattern matching in products which support only case sensitive regular expressions. </p> </div> </div><hr /><div class="manualnavbar" style="text-align: center;"> <div class="prev" style="text-align: left; float: left;"><a href="function.spliti.html">spliti</a></div> <div class="next" style="text-align: right; float: right;"><a href="book.ssdeep.html">ssdeep</a></div> <div class="up"><a href="ref.regex.html">POSIX Regex Functions</a></div> <div class="home"><a href="index.html">PHP Manual</a></div> </div></body></html>