[Pywikipedia-l] SVN: [6378] trunk/pywikipedia/wikipedia.py

nicdumz at svn.wikimedia.org nicdumz at svn.wikimedia.org
Thu Feb 19 13:57:07 UTC 2009


Revision: 6378
Author:   nicdumz
Date:     2009-02-19 13:57:07 +0000 (Thu, 19 Feb 2009)

Log Message:
-----------
Correcting regex so that linksearch() doesn't yield the request link itself

Modified Paths:
--------------
    trunk/pywikipedia/wikipedia.py

Modified: trunk/pywikipedia/wikipedia.py
===================================================================
--- trunk/pywikipedia/wikipedia.py	2009-02-19 13:18:36 UTC (rev 6377)
+++ trunk/pywikipedia/wikipedia.py	2009-02-19 13:57:07 UTC (rev 6378)
@@ -5664,7 +5664,7 @@
             siteurl = siteurl[2:]
         output(u'Querying [[Special:Linksearch]]...')
         cache = []
-        R = re.compile('title ?=\"(.*?)\"')
+        R = re.compile('title ?=\"([^<>]*?)\">[^<>]*</a></li>')
         for url in [siteurl, '*.' + siteurl]:
             offset = 0
             while True:





More information about the Pywikipedia-l mailing list