r22057 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r22056‎ | r22057 | r22058 >
Date:01:07, 10 May 2007
Author:simetrical
Status:old
Tags:
Comment:
Make ugly regex slightly less ugly. You don't have to use / for the delimiter.
Modified paths:
  • /trunk/phase3/includes/Linker.php (modified) (history)

Diff [purge]

Index: trunk/phase3/includes/Linker.php
@@ -842,7 +842,7 @@
843843 */
844844 private function formatAutocomments( $comment, $title = NULL, $local = false ) {
845845 $match = array();
846 - while (preg_match('/(.*)\/\*\s*(.*?)\s*\*\/(.*)/', $comment,$match)) {
 846+ while (preg_match('!(.*)/\*\s*(.*?)\s*\*/(.*)!', $comment,$match)) {
847847 $pre=$match[1];
848848 $auto=$match[2];
849849 $post=$match[3];