I have the code below that loops over a section of the DOM, searches for 3 different strings, and replaces each with something else. I need to make it so that an arbitrary number of items can be searched for and replaced, instead of just 3. Is that possible with jQuery?
function getDomArray(domClone){
    var postRows = [];
    $(domClone).each(function () {
        var find1 = "__hidden__";
        var find2 = "__bigtext__";
        var find3 = "col-sm-12";
        var re1 = new RegExp(find1, "g");
        var re2 = new RegExp(find2, "g");
        var re3 = new RegExp(find3, "g");
        $(this).html(function (index, html) {
            return html.replace(re1, '').replace(re2, 'bigtext').replace(re3, "col-sm-4");
        });
        postRows.push($($(this).html()).encodeHtml());  
    });
    return postRows;
}
Update 1: The code in @JonathanCard's answer throws this error:
Cannot read property 'replace' of undefined
Please see this jsFiddle: http://jsfiddle.net/jsFiddlePlayer/vhg7csb7/12/
Update 2: The code in the answer works!
 
    