Tu banner alternativo

Wikipedia:WikiProject User scripts/Scripts/Replace

This article will address the topic of Wikipedia:WikiProject User scripts/Scripts/Replace, which has been the subject of interest and debate in various areas. Wikipedia:WikiProject User scripts/Scripts/Replace has sparked the interest of experts and enthusiasts seeking to understand its impact on today's society. Throughout history, Wikipedia:WikiProject User scripts/Scripts/Replace has played a fundamental role in different contexts, and its influence remains relevant today. From its origins to its evolution, Wikipedia:WikiProject User scripts/Scripts/Replace has marked a before and after in the development of different aspects of daily life. This article will explore various perspectives and approaches that will allow the reader to delve into the fascinating world of Wikipedia:WikiProject User scripts/Scripts/Replace.

Tu banner alternativo

//

// Adds a "Replace" tab which pops up two prompt boxes; one for a regexp and one for a replacement
function wpTextboxReplace()
{
    var s = prompt("Search regexp:");
    var txt = document.editform.wpTextbox1;
    while (true) {
        if (!s) return;
        var s_r = new RegExp(s, "mg");
        if (s_r.test(txt.value)) {
            var r = prompt("Replace /"+s+"/ with:");
            r = r.replace(/\\n/g,"\n"); // unescape newlines
            if (!r && r !== '') return;
            txt.value = txt.value.replace(s_r, r);
            return;
        }
        else {
            var s_0 = s;
            s = prompt("/" + s_0 + "/ did not match anything. You may enter a new regexp:");
        }
    }
}
addOnloadHook(function () {
    if (document.forms.editform) {
        mw.util.addPortletLink('p-cactions', 'javascript:wpTextboxReplace()', 'Replace', 'ca-replace',
                       'Regexp replace for the edit window', 'R', document.getElementById('ca-history'));
    }
});
 
//

//