<?php
include_once $_SERVER['DOCUMENT_ROOT'] . '/include/shared-manual.inc';
$TOC = array();
$TOC_DEPRECATED = array();
$PARENTS = array();
include_once dirname(__FILE__) ."/toc/reference.pcre.pattern.syntax.inc";
$setup = array (
  'home' => 
  array (
    0 => 'index.php',
    1 => 'PHP Manual',
  ),
  'head' => 
  array (
    0 => 'UTF-8',
    1 => 'fr',
  ),
  'this' => 
  array (
    0 => 'regexp.reference.comments.php',
    1 => 'Commentaires',
    2 => 'Commentaires',
  ),
  'up' => 
  array (
    0 => 'reference.pcre.pattern.syntax.php',
    1 => 'Fonctionnement des expressions r&eacute;guli&egrave;res',
  ),
  'prev' => 
  array (
    0 => 'regexp.reference.conditional.php',
    1 => 'Les sous-masques conditionnels',
  ),
  'next' => 
  array (
    0 => 'regexp.reference.recursive.php',
    1 => 'Masques r&eacute;cursifs',
  ),
  'alternatives' => 
  array (
  ),
  'source' => 
  array (
    'lang' => 'fr',
    'path' => 'reference/pcre/pattern.syntax.xml',
  ),
  'history' => 
  array (
  ),
);
$setup["toc"] = $TOC;
$setup["toc_deprecated"] = $TOC_DEPRECATED;
$setup["parents"] = $PARENTS;
manual_setup($setup);

contributors($setup);

?>
<div id="regexp.reference.comments" class="section">
  <h2 class="title">Commentaires</h2>
  <p class="para">
   La séquence <code class="literal">(?#</code> marque le début d&#039;un commentaire,
   qui se termine à la prochaine parenthèse fermante. Les
   parenthèses imbriquées ne sont pas autorisées. Les
   caractères entre ces délimiteurs ne jouent alors aucun rôle
   dans le masque.
  </p>
  <p class="para">
   Si l&#039;option <a href="reference.pcre.pattern.modifiers.php" class="link">PCRE_EXTENDED</a>
   est activée, les caractères dièses
   <code class="literal">#</code> non protégés en dehors d&#039;une classe de
   caractères introduisent un commentaire qui continuera jusqu&#039;à
   la prochaine ligne dans le masque.
  </p>
  <p class="para">
   <div class="example" id="example-1">
    <p><strong>Exemple #1 Usage de commentaire dans un masque PCRE</strong></p>
    <div class="example-contents">
<div class="annotation-interactive phpcode"><code><span style="color: #000000"><span style="color: #0000BB">&lt;?php<br /><br />$subject </span><span style="color: #007700">= </span><span style="color: #DD0000">'test'</span><span style="color: #007700">;<br /><br /></span><span style="color: #FF8000">/* (?# can be used to add comments without enabling PCRE_EXTENDED */<br /></span><span style="color: #0000BB">$match </span><span style="color: #007700">= </span><span style="color: #0000BB">preg_match</span><span style="color: #007700">(</span><span style="color: #DD0000">'/te(?# this is a comment)st/'</span><span style="color: #007700">, </span><span style="color: #0000BB">$subject</span><span style="color: #007700">);<br /></span><span style="color: #0000BB">var_dump</span><span style="color: #007700">(</span><span style="color: #0000BB">$match</span><span style="color: #007700">);<br /><br /></span><span style="color: #FF8000">/* Whitespace and # is treated as part of the pattern unless PCRE_EXTENDED is enabled */<br /></span><span style="color: #0000BB">$match </span><span style="color: #007700">= </span><span style="color: #0000BB">preg_match</span><span style="color: #007700">(</span><span style="color: #DD0000">'/te   #~~~~<br />st/'</span><span style="color: #007700">, </span><span style="color: #0000BB">$subject</span><span style="color: #007700">);<br /></span><span style="color: #0000BB">var_dump</span><span style="color: #007700">(</span><span style="color: #0000BB">$match</span><span style="color: #007700">);<br /><br /></span><span style="color: #FF8000">/* When PCRE_EXTENDED is enabled, all whitespace data characters and anything<br />   that follows an unescaped # on the same line is ignored */<br /></span><span style="color: #0000BB">$match </span><span style="color: #007700">= </span><span style="color: #0000BB">preg_match</span><span style="color: #007700">(</span><span style="color: #DD0000">'/te    #~~~~<br />st/x'</span><span style="color: #007700">, </span><span style="color: #0000BB">$subject</span><span style="color: #007700">);<br /></span><span style="color: #0000BB">var_dump</span><span style="color: #007700">(</span><span style="color: #0000BB">$match</span><span style="color: #007700">);</span></span></code></div>
    </div>

    <div class="example-contents"><p>L&#039;exemple ci-dessus va afficher :</p></div>
    <div class="example-contents screen">
<div class="annotation-interactive cdata"><pre>
int(1)
int(0)
int(1)
</pre></div>
    </div>
   </div>
  </p>
 </div><?php manual_footer($setup); ?>