Design Phoenix made an awesome script, I modified the script so that you get a prompt and enter in the values right in Illustrator
Script below:
#target illustrator
var doc = app.activeDocument;
jsfind = prompt("Find: ", "");
jsreplace = prompt("Replace: ", "");
for ( var i=0; i<doc.artboards.length ;i++) {
var aBoard = doc.artboards[i].active;
var oldName = doc.artboards[i].name;
doc.artboards[i].name = oldName.replace (jsfind, jsreplace);
}
Note, this script is case sensitive.
The script can easily be modified to work for layers instead of artboards. FindReplaceLayers.jsx
If you wanted to use REGEX while searching, just add the following line of code to the script:
var jsfindREGEX = new RegExp(jsfind,"g");
In this line replace jsfind
with regex
oldName.replace (jsfindREGEX, jsreplace);
You can find both Regex script on Github.
FindReplaceArtboardsREGEX.jsx
FindReplaceLayersREGEX.jsx
And as GerardFalla nicely pointed out, you can also use the layers script in Photoshop which is very helpful.