Mass edit using regular expressions
Enter one or more regular expressions (one per line) for matching, and one or more expressions to replace each match with. The first match-expression, if successful, will be replaced with the first replace-expression, and so on. See the PHP function preg_replace() for details.
Here are some hints and examples for accomplishing common tasks:
Match | Replace | Effect |
---|---|---|
/$/ | abc | Append some text to the end of the page - great for adding pages to categories |
/$/ | \n[[Category:New]] | Append some text to the end of the page - great for adding pages to categories |
/{{OldTemplate}}/ | Remove some text from all the pages in the list | |
/\[\[Category:[^]]+\]\]/ | Remove all categories from a page (note the escaping of the square brackets in the wikicode.) The replacement values should not be escaped. | |
/(\[\[[^]]*\|[^]]*)AAA(.*\]\])/ | $1BBB$2 | Replace AAA with BBB in link text but not the link destination: [[AAA|AAA]] becomes [[AAA|BBB]] |