<?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 => 'ru',
  ),
  'this' => 
  array (
    0 => 'function.mb-regex-set-options.php',
    1 => 'mb_regex_set_options',
    2 => 'Устанавливает или получает значение по умолчанию для настроек функций mbregex',
  ),
  'up' => 
  array (
    0 => 'ref.mbstring.php',
    1 => 'Функции для работы с многобайтовыми строками',
  ),
  'prev' => 
  array (
    0 => 'function.mb-regex-encoding.php',
    1 => 'mb_regex_encoding',
  ),
  'next' => 
  array (
    0 => 'function.mb-rtrim.php',
    1 => 'mb_rtrim',
  ),
  'alternatives' => 
  array (
  ),
  'source' => 
  array (
    'lang' => 'ru',
    'path' => 'reference/mbstring/functions/mb-regex-set-options.xml',
  ),
  'history' => 
  array (
  ),
);
$setup["toc"] = $TOC;
$setup["toc_deprecated"] = $TOC_DEPRECATED;
$setup["parents"] = $PARENTS;
manual_setup($setup);

contributors($setup);

?>
<div id="function.mb-regex-set-options" class="refentry">
 <div class="refnamediv">
  <h1 class="refname">mb_regex_set_options</h1>
  <p class="verinfo">(PHP 4 &gt;= 4.3.0, PHP 5, PHP 7, PHP 8)</p><p class="refpurpose"><span class="refname">mb_regex_set_options</span> &mdash; <span class="dc-title">
   Устанавливает или получает значение по умолчанию для настроек функций mbregex
  </span></p>

 </div>

 <div class="refsect1 description" id="refsect1-function.mb-regex-set-options-description">
  <h3 class="title">Описание</h3>
  <div class="methodsynopsis dc-description">
   <span class="methodname"><strong>mb_regex_set_options</strong></span>(<span class="methodparam"><span class="type"><span class="type"><a href="language.types.null.php" class="type null">?</a></span><span class="type"><a href="language.types.string.php" class="type string">string</a></span></span> <code class="parameter">$options</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.string.php" class="type string">string</a></span></div>

  <p class="simpara">
   Устанавливает параметры по умолчанию, описанные в параметре <code class="parameter">options</code>, для функций
   регулярных выражений, работающих со строками в многобайтных кодировках.
  </p>
 </div>


 <div class="refsect1 parameters" id="refsect1-function.mb-regex-set-options-parameters">
  <h3 class="title">Список параметров</h3>
  <p class="para">
   <dl>
    
     <dt><code class="parameter">options</code></dt>
     <dd>
      <p class="para">
       Настройки, которые нужно задать. Это строка, в которой каждый
       символ отвечает за какую-то настройку. Чтобы установить режим,
       необходимо указать его символ в конце строки, однако, можно задать только один режим,
       но несколько опций.
      </p>

      <table class="doctable table">
       <caption><strong>Настройки регулярных выражений</strong></caption>
       
        <thead>
         <tr>
          <th>Настройка</th>
          <th>Описание</th>
          <th>Список изменений</th>
         </tr>

        </thead>

        <tbody class="tbody">
         <tr>
          <td>i</td>
          <td>Включение неоднозначных совпадений</td>
          <td class="empty">&nbsp;</td>
         </tr>

         <tr>
          <td>x</td>
          <td>Включает форму расширенного шаблона</td>
          <td class="empty">&nbsp;</td>
         </tr>

         <tr>
          <td>m</td>
          <td><code class="literal">&#039;.&#039;</code> совпадения с переводами строк</td>
          <td class="empty">&nbsp;</td>
         </tr>

         <tr>
          <td>s</td>
          <td><code class="literal">«^»</code> → <code class="literal">«\A»</code>, <code class="literal">«$»</code> → <code class="literal">«\Z»</code></td>
          <td class="empty">&nbsp;</td>
         </tr>

         <tr>
          <td>p</td>
          <td>То же, что и объединение настроек <code class="literal">m</code> и <code class="literal">s</code></td>
          <td class="empty">&nbsp;</td>
         </tr>

         <tr>
          <td>l</td>
          <td>Поиск совпадений с наибольшей длиной</td>
          <td class="empty">&nbsp;</td>
         </tr>

         <tr>
          <td>n</td>
          <td>Игнорировать пустые совпадения</td>
          <td class="empty">&nbsp;</td>
         </tr>

         <tr>
          <td>e</td>
          <td>Вычисление кода результата функцией <span class="function"><a href="function.eval.php" class="function">eval()</a></span></td>
          <td>Объявлено устаревшим в PHP 7.1.0 и удалено в PHP 8.0.0</td>
         </tr>

        </tbody>
       
      </table>

      <blockquote class="note"><p><strong class="note">Замечание</strong>: 
       <p class="para">
        Настройка <code class="literal">«e»</code> не даёт эффекта при установке через функцию <span class="function"><strong>mb_regex_set_options()</strong></span>.
        Её указывают с функциями <span class="function"><a href="function.mb-ereg-replace.php" class="function">mb_ereg_replace()</a></span> или <span class="function"><a href="function.mb-eregi-replace.php" class="function">mb_eregi_replace()</a></span>.
       </p>
      </p></blockquote>
      <table class="doctable table">
       <caption><strong>Синтаксические режимы регулярных выражений (может быть задан только один)</strong></caption>
       
        <thead>
         <tr>
          <th>Режим</th>
          <th>Описание</th>
         </tr>

        </thead>

        <tbody class="tbody">
         <tr>
          <td>j</td>
          <td>Java (Sun java.util.regex)</td>
         </tr>

         <tr>
          <td>u</td>
          <td>Регулярные выражения GNU</td>
         </tr>

         <tr>
          <td>g</td>
          <td>grep</td>
         </tr>

         <tr>
          <td>c</td>
          <td>Emacs</td>
         </tr>

         <tr>
          <td>r</td>
          <td>Ruby</td>
         </tr>

         <tr>
          <td>z</td>
          <td>Perl</td>
         </tr>

         <tr>
          <td>b</td>
          <td>Регулярные выражения POSIX Basic</td>
         </tr>

         <tr>
          <td>d</td>
          <td>Регулярные выражения POSIX Extended</td>
         </tr>

        </tbody>
       
      </table>

     </dd>
    
   </dl>
  </p>
 </div>


 <div class="refsect1 returnvalues" id="refsect1-function.mb-regex-set-options-returnvalues">
  <h3 class="title">Возвращаемые значения</h3>
  <p class="para">
   Возвращает предыдущие настройки. Если параметр <code class="parameter">options</code> опущен или равен <strong><code><a href="reserved.constants.php#constant.null">null</a></code></strong>,
   возвращает строку (<span class="type"><a href="language.types.string.php" class="type string">string</a></span>), которая описывает текущие параметры.
  </p>
 </div>


 <div class="refsect1 changelog" id="refsect1-function.mb-regex-set-options-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>
       Если параметр <code class="parameter">options</code> задан и не равен <strong><code><a href="reserved.constants.php#constant.null">null</a></code></strong>,
       возвращаются <em>предыдущие</em>
       параметры. Ранее возвращались <em>текущие</em> параметры.
      </td>
     </tr>

     <tr>
      <td>8.0.0</td>
      <td>
       Параметр <code class="parameter">options</code> теперь может принимать значение <strong><code><a href="reserved.constants.php#constant.null">null</a></code></strong>.
      </td>
     </tr>

     <tr>
      <td>8.0.0</td>
      <td>
       Опция <code class="literal">«e»</code> теперь выбрасывает исключение <span class="classname"><a href="class.valueerror.php" class="classname">ValueError</a></span>.
      </td>
     </tr>

     <tr>
      <td>7.1.0</td>
      <td>
       Опция <code class="literal">«e»</code> теперь выдаёт ошибку уровня <span class="classname"><a href="class.valueerror.php" class="classname">ValueError</a></span>.
      </td>
     </tr>

    </tbody>
   
  </table>

 </div>


 <div class="refsect1 seealso" id="refsect1-function.mb-regex-set-options-seealso">
  <h3 class="title">Смотрите также</h3>
  <p class="para">
   <ul class="simplelist">
    <li><span class="function"><a href="function.mb-split.php" class="function" rel="rdfs-seeAlso">mb_split()</a> - Разбивает многобайтовую строку регулярным выражением</span></li>
    <li><span class="function"><a href="function.mb-ereg.php" class="function" rel="rdfs-seeAlso">mb_ereg()</a> - Находит совпадение регулярному выражению с поддержкой многобайтовых кодировок</span></li>
    <li><span class="function"><a href="function.mb-eregi.php" class="function" rel="rdfs-seeAlso">mb_eregi()</a> - Находит соответствие регулярному выражению с поддержкой многобайтовых символов без учёта регистра</span></li>
   </ul>
  </p>
 </div>


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