diff --git a/Mustache.php b/Mustache.php index 3b43a4fb..34c5e15d 100644 --- a/Mustache.php +++ b/Mustache.php @@ -274,7 +274,7 @@ protected function _renderSections($template) { */ protected function _prepareSectionRegEx($otag, $ctag) { return sprintf( - '/(?:(?<=\\n)[ \\t]*)?%s(?[%s])(?.+?)%s\\n?/s', + '/(?:(?<=\\n)[ \\t]*)?%s(?P[%s])(?P.+?)%s\\n?/s', preg_quote($otag, '/'), self::SECTION_TYPES, preg_quote($ctag, '/') @@ -354,7 +354,7 @@ protected function _findSection($template) { */ protected function _preparePragmaRegEx($otag, $ctag) { return sprintf( - '/%s%%\\s*(?[\\w_-]+)(?(?: [\\w]+=[\\w]+)*)\\s*%s\\n?/s', + '/%s%%\\s*(?P[\\w_-]+)(?P(?: [\\w]+=[\\w]+)*)\\s*%s\\n?/s', preg_quote($otag, '/'), preg_quote($ctag, '/') ); @@ -467,7 +467,7 @@ protected function _throwsException($exception) { */ protected function _prepareTagRegEx($otag, $ctag) { return sprintf( - '/(?(?<=\\n)[ \\t]*)?%s(?[%s]?)(?.+?)(?:\\2|})?%s(?:\\s*(?=\\n))?/s', + '/(?P(?<=\\n)[ \\t]*)?%s(?P[%s]?)(?P.+?)(?:\\2|})?%s(?:\\s*(?=\\n))?/s', preg_quote($otag, '/'), self::TAG_TYPES, preg_quote($ctag, '/')