Topic on Extension talk:Replace Text

Not finding text in page titles unless I use regular expressions

3
Tenzel Kim (talkcontribs)

Need to change the text in parentheses in page names, but whenever I do a replace text with (Old Text) in the Original text field and (New Text) in the Replacement Text field I don't get any pages that have (Old Text) in the page name.

When I click Use regular expressions I get all pages that have Old Text in the page name (whether or not it is in parentheses) but that won't work as I need the parentheses and in some cases need to replace with (New Text) (Another New Text) for instance.

Note: This is only an issue when wanting to "Replace text in page titles"

Used versions: MediaWiki 1.34.4 Replace Text 1.4.1 MySQL Version 10.2.37-MariaDB-log PHP 7.2.34 (cgi-fcgi)

MvGulik (talkcontribs)

>... When I click Use regular expressions I get all pages that have Old Text in the page name (whether or not it is in parentheses) ...


This makes sense if you did not escape the parentheses in RE mode. As parentheses in RE mode indicate a capture group, and are as such not used for text matching.


Escaping the parentheses in RE mode ("(foo)" => RE:"\(foo\)") might not change the other outcome though.

Tenzel Kim (talkcontribs)

MvGulik's suggestion seem to work as a workaround.

I found that if I click BOTH "Replace text in page contents" and "Replace text in page titles, when possible" I can find and change the page names as well (I just have to deselect ALL the "replace in page contents" hits to avoid those being changed as well)

Also if I select a category in "Replace only in category" it states that the category doesn't exist unless I chose "replace in page contents" as well.

Reply to "Not finding text in page titles unless I use regular expressions"