regexp for ReplaceText

regexp for ReplaceText

Hi. As discuss here, could you try the follwing regex in Special:ReplaceText for theese messages?

~ $ cat test.txt

[[:$1]] and {{PLURAL:$2|one page|$2 pages}} added to category

~ $ sed -r 's/(\{\{PLURAL.*\}\})/[[Special:WhatLinksHere\/$1|\1]]/' test.txt

[[:$1]] and [[Special:WhatLinksHere/$1|{{PLURAL:$2|one page|$2 pages}}]] added to category

Let me know if you need help. I'm not familiar with ReplaceText and what sort of regex it accepts.

UPDATE: also here

Macofe (talk)18:39, 20 March 2016

Sorry, I am not a regex expert. Someone else should handle this request.

Raymond09:53, 23 March 2016
 

This can't be done with ReplaceText, because there is no reliable way to skip the messages where Special:WhatLinksHere already exists; moreover, some messages have multiple occurrences of PLURAL and other exceptions. For such small replacements, doing manually saves a lot of time; if you want to exercise with regexes, I recommend using pywikibot which has way better regex handling, presents you the diff and lets you confirm it, and many other features.

You can still ask about ReplaceText for bigger replacements of course.

Nemo (talk)08:18, 25 March 2016