<?php
include_once $_SERVER['DOCUMENT_ROOT'] . '/include/shared-manual.inc';
$TOC = array();
$TOC_DEPRECATED = array();
$PARENTS = array();
include_once dirname(__FILE__) ."/toc/ref.mbstring.inc";
$setup = array (
  'home' => 
  array (
    0 => 'index.php',
    1 => 'PHP Manual',
  ),
  'head' => 
  array (
    0 => 'UTF-8',
    1 => 'zh',
  ),
  'this' => 
  array (
    0 => 'function.mb-ereg.php',
    1 => 'mb_ereg',
    2 => 'Regular expression match with multibyte support',
  ),
  'up' => 
  array (
    0 => 'ref.mbstring.php',
    1 => '多字节字符串 函数',
  ),
  'prev' => 
  array (
    0 => 'function.mb-encoding-aliases.php',
    1 => 'mb_encoding_aliases',
  ),
  'next' => 
  array (
    0 => 'function.mb-ereg-match.php',
    1 => 'mb_ereg_match',
  ),
  'alternatives' => 
  array (
  ),
  'source' => 
  array (
    'lang' => 'en',
    'path' => 'reference/mbstring/functions/mb-ereg.xml',
  ),
  'history' => 
  array (
  ),
);
$setup["toc"] = $TOC;
$setup["toc_deprecated"] = $TOC_DEPRECATED;
$setup["parents"] = $PARENTS;
manual_setup($setup);

contributors($setup);

?>
<div id="function.mb-ereg" class="refentry">
 <div class="refnamediv">
  <h1 class="refname">mb_ereg</h1>
  <p class="verinfo">(PHP 4 &gt;= 4.2.0, PHP 5, PHP 7, PHP 8)</p><p class="refpurpose"><span class="refname">mb_ereg</span> &mdash; <span class="dc-title">Regular expression match with multibyte support</span></p>

 </div>
   
 <div class="refsect1 description" id="refsect1-function.mb-ereg-description">
  <h3 class="title">说明</h3>
  <div class="methodsynopsis dc-description">
   <span class="methodname"><strong>mb_ereg</strong></span>(<span class="methodparam"><span class="type"><a href="language.types.string.php" class="type string">string</a></span> <code class="parameter">$pattern</code></span>, <span class="methodparam"><span class="type"><a href="language.types.string.php" class="type string">string</a></span> <code class="parameter">$string</code></span>, <span class="methodparam"><span class="type"><a href="language.types.array.php" class="type array">array</a></span> <code class="parameter reference">&$matches</code><span class="initializer"> = <strong><code><a href="reserved.constants.php#constant.null">null</a></code></strong></span></span>): <span class="type"><a href="language.types.boolean.php" class="type bool">bool</a></span></div>

  <p class="simpara">
   Executes the regular expression match with multibyte support.
  </p>
 </div>


 <div class="refsect1 parameters" id="refsect1-function.mb-ereg-parameters">
  <h3 class="title">参数</h3>
  <p class="para">
   <dl>
    
     <dt><code class="parameter">pattern</code></dt>
     <dd>
      <p class="para">
       The search pattern.
      </p>
     </dd>
    
    
     <dt><code class="parameter">string</code></dt>
     <dd>
      <p class="para">
       The search <span class="type"><a href="language.types.string.php" class="type string">string</a></span>.
      </p>
     </dd>
    
    
     <dt><code class="parameter">matches</code></dt>
     <dd>
      <p class="para">
       If matches are found for parenthesized substrings of
       <code class="parameter">pattern</code> and the function is called with the
       third argument <code class="parameter">matches</code>, the matches will be stored
       in the elements of the array <code class="parameter">matches</code>.
       If no matches are found, <code class="parameter">matches</code> is set to an empty
       array.
      </p>
      <p class="para">
       <var class="varname">$matches[1]</var> will contain the substring which starts at
       the first left parenthesis; <var class="varname">$matches[2]</var> will contain
       the substring starting at the second, and so on.
       <var class="varname">$matches[0]</var> will contain a copy of the complete string
       matched.
      </p>
     </dd>
    
   </dl>
  </p>
 </div>

 
 <div class="refsect1 returnvalues" id="refsect1-function.mb-ereg-returnvalues">
  <h3 class="title">返回值</h3>
  <p class="para">
   Returns whether <code class="parameter">pattern</code> matches <code class="parameter">string</code>.
  </p>
 </div>


 <div class="refsect1 changelog" id="refsect1-function.mb-ereg-changelog">
  <h3 class="title">更新日志</h3>
  <table class="doctable informaltable">
   
    <thead>
     <tr>
      <th>版本</th>
      <th>说明</th>
     </tr>

    </thead>

    <tbody class="tbody">
     <tr>
      <td>8.0.0</td>
      <td>
       This function returns <strong><code><a href="reserved.constants.php#constant.true">true</a></code></strong> on success now. Previously, it returned the byte length
       of the matched string if a match for <code class="parameter">pattern</code> was found in
       <code class="parameter">string</code> and <code class="parameter">matches</code> was passed.
       If the optional parameter <code class="parameter">matches</code> was not passed or
       the length of the matched string was <code class="literal">0</code>, this function returned <code class="literal">1</code>.
      </td>
     </tr>

     <tr>
      <td>7.1.0</td>
      <td>
       <span class="function"><strong>mb_ereg()</strong></span> will now set <code class="parameter">matches</code> to
       an empty <span class="type"><a href="language.types.array.php" class="type array">array</a></span>, if nothing matched. Formerly,
       <code class="parameter">matches</code> was not modified in that case.
      </td>
     </tr>

    </tbody>
   
  </table>

 </div>


 <div class="refsect1 notes" id="refsect1-function.mb-ereg-notes">
  <h3 class="title">注释</h3>
  
  <blockquote class="note"><p><strong class="note">注意</strong>: <p class="para"><span class="function"><a href="function.mb-regex-encoding.php" class="function">mb_regex_encoding()</a></span>
指定的内部编码或字符编码将会当作此函数用的字符编码。</p></p></blockquote>
 </div>


 <div class="refsect1 seealso" id="refsect1-function.mb-ereg-seealso">
  <h3 class="title">参见</h3>
  <p class="para">
   <ul class="simplelist">
    <li><span class="function"><a href="function.mb-regex-encoding.php" class="function" rel="rdfs-seeAlso">mb_regex_encoding()</a> - Set/Get character encoding for multibyte regex</span></li>
    <li><span class="function"><a href="function.mb-eregi.php" class="function" rel="rdfs-seeAlso">mb_eregi()</a> - Regular expression match ignoring case with multibyte support</span></li>
   </ul>
  </p>
 </div>


</div><?php manual_footer($setup); ?>