plugins/geshi/geshi/php-brief.php
changeset 3 f3e2bbbd2155
parent 2 9e3258dfae15
--- a/plugins/geshi/geshi/php-brief.php	Fri May 29 19:30:59 2009 -0400
+++ b/plugins/geshi/geshi/php-brief.php	Fri May 29 19:40:15 2009 -0400
@@ -4,7 +4,7 @@
  * -------------
  * Author: Nigel McNie (nigel@geshi.org)
  * Copyright: (c) 2004 Nigel McNie (http://qbnz.com/highlighter/)
- * Release Version: 1.0.8.2
+ * Release Version: 1.0.8.4
  * Date Started: 2004/06/02
  *
  * PHP (brief version) language file for GeSHi.
@@ -185,8 +185,28 @@
         3 => array(
             '<script language="php">' => '</script>'
             ),
-        4 => "/(<\?(?:php)?)(?:'(?:[^'\\\\]|\\\\.)*?'|\"(?:[^\"\\\\]|\\\\.)*?\"|\/\*(?!\*\/).*?\*\/|.)*?(\?>|\Z)/sm",
-        5 => "/(<%)(?:'(?:[^'\\\\]|\\\\.)*?'|\"(?:[^\"\\\\]|\\\\.)*?\"|\/\*(?!\*\/).*?\*\/|.)*?(%>|\Z)/sm"
+        4 => "/(?<start><\\?(?>php\b)?)(?:".
+            "(?>[^\"'?\\/<]+)|".
+            "\\?(?!>)|".
+            "(?>'(?>[^'\\\\]|\\\\'|\\\\\\\|\\\\)*')|".
+            "(?>\"(?>[^\"\\\\]|\\\\\"|\\\\\\\\|\\\\)*\")|".
+            "(?>\\/\\*(?>[^\\*]|(?!\\*\\/)\\*)*\\*\\/)|".
+            "\\/\\/(?>.*?$)|".
+            "\\/(?=[^*\\/])|".
+            "<(?!<<)|".
+            "<<<(?<phpdoc>\w+)\s.*?\s\k<phpdoc>".
+            ")*(?<end>\\?>|\Z)/sm",
+        5 => "/(?<start><%)(?:".
+            "(?>[^\"'%\\/<]+)|".
+            "%(?!>)|".
+            "(?>'(?>[^'\\\\]|\\\\'|\\\\\\\|\\\\)*')|".
+            "(?>\"(?>[^\\\"\\\\]|\\\\\"|\\\\\\\\|\\\\)*\")|".
+            "(?>\\/\\*(?>[^\\*]|(?!\\*\\/)\\*)*\\*\\/)|".
+            "\\/\\/(?>.*?$)|".
+            "\\/(?=[^*\\/])|".
+            "<(?!<<)|".
+            "<<<(?<phpdoc>\w+)\s.*?\s\k<phpdoc>".
+            ")*(?<end>%>)/sm"
         ),
     'HIGHLIGHT_STRICT_BLOCK' => array(
         0 => true,
@@ -199,4 +219,4 @@
     'TAB_WIDTH' => 4
 );
 
-?>
+?>
\ No newline at end of file