User:Dimpizzy/MassEditRegex Guide
MassEditRegex can be used as an alternative to ReplaceText.
- Enable the extension, which is located under the Special Pages tab of the ManageWiki extension settings. It is called
Mass Edit via Regular Expressions
. The extension may take some time to activate.
- Once activated, you can go to
Special:MassEditRegex
on your wiki, or follow the link on the Special Pages page, in the Page Tools section. - You can choose which pages to replace text in by selecting one of the four toggle options and entering text into the
Pages to edit
box.- To replace text in all pages in a category, choose
Category Names
. - To replace text in specific pages, choose
Page Names
. - If you would like to replace text in all pages, first go to Special:AllPages, then select and copy the list of pages. Paste the text into the
Pages to edit
text box.
- To replace text in all pages in a category, choose
- You can search for text to replace with regular expressions which allows for complicated searches, but you can do a simple search by putting the text to search for in the
Search for
text box, surrounded by forward slashes.- For example, to search for the text
Hello
, enter/Hello/
into theSearch for
box. - There are certain characters that are "special" in regex, which means if you are searching for them, you need to place a back slash,
\
, before those characters, or they will be interpreted as regex commands. Those characters are.
,+
,*
,?
,^
,$
,(
,)
,[
,]
,{
,},
|
,/
, and\
. - For example, to search for
{{Template|parameter}}
, you would enter the text/\{\{Template\|parameter\}\}/
. Note that the text is case sensitive./Template/
will match withTemplate
but not withtemplate
.
- For example, to search for the text
- Place the text you wish to replace the searched text with in the
Replace with
text box. - Press Show Preview before making any edits to make sure the edits are correct. If it seems good, you can press Execute to make the edits.
If you get an error saying that the pages do not exist, that probably means that the text in the Search for
box is not proper regex. Make sure the text is surrounded with forward slashes and that all special characters are escaped with a back slash.
Feel free to edit and improve this guide.