Community Central

Search and replace with Pywikipediabot

Forum page

19,227pages on
this wiki
Add New Page

This Forum has been archived

Visit the new Forums
Forums: Index Support Requests Search and replace with Pywikipediabot
Fandom's forums are a place for the community to help other members.
To contact staff directly or to report bugs, please use Special:Contact.
Note: This topic has been unedited for 1680 days. It is considered archived - the discussion is over. Do not add to unless it really needs a response.


I am trying to search and replace sections of several lines with "". Let's say for example the page content is


and I want to replace the first two lines with "new" so the new content is


How can I do this? I tried something like -multiline -page:mypage "^first$^second$" "new"

but that doesn't work.

Any ideas? Thanks in advance --Weas-El@fandom 18:35, June 14, 2012 (UTC)

I'm referring Randomtime here. He's who I go to for pybot questions. Rappy 19:16, June 14, 2012 (UTC)
C:\Pybot> -page:FindReplace -regex "first\r\nsecond" "new"
works a treat "\r\n" are the escape characters for a new line in the rejex. -- RandomTime 19:44, June 14, 2012 (UTC)
Great, I'll try that, thanks. --Weas-El@fandom 20:19, June 14, 2012 (UTC)

Ad blocker interference detected!

Wikia is a free-to-use site that makes money from advertising. We have a modified experience for viewers using ad blockers

Wikia is not accessible if you’ve made further modifications. Remove the custom ad blocker rule(s) and the page will load as expected.

Also on Fandom

Random Wiki