svn: /web/doc-editor/trunk/php/ File.php

[email protected] (Yannick Torres)
Newsgroups php.doc.web
Message-ID <[email protected]>
yannick                                  Wed, 30 Dec 2009 18:18:47 +0000

Revision: http://svn.php.net/viewvc?view=revision&revision=292821

Log:
Fix the regex for the diff. Thanks to gwynne and ackana@freenode#regex

Changed paths:
    U   web/doc-editor/trunk/php/File.php

Modified: web/doc-editor/trunk/php/File.php
===================================================================
--- web/doc-editor/trunk/php/File.php	2009-12-30 18:00:15 UTC (rev 292820)
+++ web/doc-editor/trunk/php/File.php	2009-12-30 18:18:47 UTC (rev 292821)
@@ -309,7 +309,7 @@
         );
         $output = htmlentities(join("\n", $output));
         $match = array();
-        preg_match_all('/@@(.*?)@@(.*(?!@@).*)/s', $output, $match);
+        preg_match_all('/@@([^@]+)@@(.*?)(?=@@|\z)/si', $output, $match);

         $diff = array();
         for ($i = 0; $i < count($match[1]); $i++) {
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.