Last modified: 2013-10-05 04:22:20 UTC
Originally from: http://sourceforge.net/p/pywikipediabot/feature-requests/187/ Reported by: Anonymous user Created on: 2009-03-25 22:01:02 Subject: regexp functionality for -hint option Original description: it would be great if -hint option in interwiki.py bot could accept regular expressions. this can be helpful, e.g. if in one wiki the article is entitled "XXX, YYY" and the corresponding article in another wiki is "XXX \(YYY\)", or if titles differ in some letters and these differences are regular between languages.
Interesting suggestion \(but I haven't looked at how to implement this -- yet\) Do you have any actual application for this? Any such regular patterns between two different wikis that you already know? That would be quite useful to provide some concrete examples here, to help potential devs =\)
The syntax might be similar to that used in replace.py. For example, to use English hint \(Abbeville, Alabama\) for the French article "Abbeville \(Alabama\)", the command might look something like: python interwiki.py -lang:fr -hint:en -regex ".+ \\\(.+\\\)" "\1, \2"