Comments

The sequence (?# marks the start of a comment which continues up to the next closing parenthesis. Nested parentheses are not permitted. The characters that make up a comment play no part in the pattern matching at all.

If the PCRE_EXTENDED option is set, an unescaped # character outside a character class introduces a comment that continues up to the next newline character in the pattern.

Коментарии

<?php
$string 
'test';
echo 
preg_match('/te(?# comments)st/'$string) . "\n";
echo 
preg_match('/te#~~~~
st/'
$string) . "\n";
echo 
preg_match('/te#~~~~
st/x'
$string) . "\n";

// result
// 1
// 0
// 1
2017-01-24 02:00:51
http://php5.kiev.ua/manual/ru/regexp.reference.comments.html

    Поддержать сайт на родительском проекте КГБ