Pybot Wiki
Advertisement

Troubles with Negative Lookahead[]

I am trying to use the negative lookahead syntax (?!...) to look for pages on our wiki to categorise, however I can't seem to get it to work. The pipeline I'm trying to use is the following:

$ python pwb.py category add -titleregex:'(?!(W|w)edding of )(R|r)iver (S|s)ong' -family:dwa

It is supposed to match titles which contain the words "River Song" ignoring case, unless those words are part of the larger string "Wedding of River Song", again ignoring case, however this isn't working, as one of the first pages returned is "Between 'Closing Time' and 'The Wedding of River Song'(not sure which episodes), did the Doctor age 200 years", which obviously contains the substring I don't want. Am I using the lookahead incorrectly? How should I be phrasing the regex to match what I want? Please be aware that I'm new to pywikibot, so please excuse any noobishness on my part. Imamadmad 12:32, May 11, 2015 (UTC)

Advertisement