r112682 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r112681‎ | r112682 | r112683 >
Date:13:02, 29 February 2012
Author:gwicke
Status:deferred
Tags:
Comment:
Capturing the regexp is no longer necessary, and speeds up the grepper. Also
tweaked the multi-line ISBN regexp slightly.
Modified paths:
  • /trunk/extensions/VisualEditor/tests/parser/dumpGrepPatterns/misc.txt (modified) (history)
  • /trunk/extensions/VisualEditor/tests/parser/dumpGrepper.js (modified) (history)

Diff [purge]

Index: trunk/extensions/VisualEditor/tests/parser/dumpGrepPatterns/misc.txt
@@ -1,4 +1,7 @@
22 # A collection of misc interesting regexps
33
4 -# Multi-line ISBN links (https://bugzilla.wikimedia.org/show_bug.cgi?id=29025)
 4+# ISBN links with at least one line break (https://bugzilla.wikimedia.org/show_bug.cgi?id=29025)
55 (?:(?:RFC|PMID)[ \t\n\r\f]*[\n\f\r]+[ \t\n\r\f]*([0-9]+)|ISBN[ \t\n\r\f]*[\n\f\r]+[ \t\n\r\f]*(\b(?:97[89][ -]?)?(?:[0-9][ -]?){9}[0-9Xx]\b))
 6+
 7+# ISBN links with at least two line breaks (https://bugzilla.wikimedia.org/show_bug.cgi?id=29025)
 8+(?:(?:RFC|PMID)[ \t\n\r\f]*(?:[\n\f\r][ \t\n\r\f]*){2,}([0-9]+)|ISBN[ \t\n\r\f]*(?:[\n\f\r][ \t\n\r\f]*){2,}(\b(?:97[89][ -]?)?(?:[0-9][ -]?){9}[0-9Xx]\b))
Index: trunk/extensions/VisualEditor/tests/parser/dumpGrepper.js
@@ -56,7 +56,7 @@
5757 flags += 'i';
5858 }
5959
60 - var re = new RegExp( '(' + argv._[0] + ')', flags );
 60+ var re = new RegExp( argv._[0], flags );
6161
6262 var reader = new dumpReader.DumpReader(),
6363 grepper = new DumpGrepper( re );

Status & tagging log