User:Dimpizzy/MassEditRegex Guide

From Miraheze Meta, Miraheze's central coordination wiki

MassEditRegex can be used as an alternative to ReplaceText.

  1. 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.
  1. 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.
  2. 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.
    1. To replace text in all pages in a category, choose Category Names.
    2. To replace text in specific pages, choose Page Names.
    3. 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.
  3. 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.
    1. For example, to search for the text Hello, enter /Hello/ into the Search for box.
    2. 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 \.
    3. For example, to search for {{Template|parameter}}, you would enter the text /\{\{Template\|parameter\}\}/. Note that the text is case sensitive. /Template/ will match with Template but not with template.
  4. Place the text you wish to replace the searched text with in the Replace with text box.
  5. 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.