Dvorapa added a comment.

Try it by yourself:

$ python pwb.py shell
Welcome to the Pywikibot interactive shell!
>>> t="<ref name=etwa /> text <ref> fer </ref>"
>>> import pywikibot.textlib as tl
>>> tl.replaceExcept(t, r"text", r"xext", ['ref'])
'<ref name=etwa /> text <ref> fer </ref>'
>>> tl.replaceExcept(t, r"text", r"xext", [])
'<ref name=etwa /> xext <ref> fer </ref>'

TASK DETAIL
https://phabricator.wikimedia.org/T203568

EMAIL PREFERENCES
https://phabricator.wikimedia.org/settings/panel/emailpreferences/

To: Dvorapa
Cc: Dalba, Dvorapa, Mpaa, Xqt, pywikibot-bugs-list, Aklapper, jeblad, Hercule, Tbscho, MayS, Mdupont, JJMC89, Avicennasis, mys_721tx, jayvdb, Masti, Alchimista, Rxy
_______________________________________________
pywikibot-bugs mailing list
[email protected]
https://lists.wikimedia.org/mailman/listinfo/pywikibot-bugs

Reply via email to