User:Jonesey95/AutoEd/replace.js

function ReplaceStrings(str) { //MAIN FUNCTION describes list of fixes

//Replace coauthors with author // str = str.replace(/\ +coauthors *=/gi, '\ author ='); //Replace bad Time magazine ISSN str = str.replace(/issn\s*=\s*0040-718X/g, 'issn=0040-781X'); //Comment out invalid Billboard Brasil ISSN (probably a UPC) str = str.replace(/(issn\s*=\s*977-\s*217605400-2\s*\|*)/gi, ''); str = str.replace(/(issn\s*=\s*977-2155985400-2)/gi, ''); str = str.replace(/(issn\s*=\s*977-879605400-2)/gi, ''); //Replace ISSN lower-case x with uppercase X str = str.replace(/(issn\s*=\s*\d\d\d\d-*\d\d\d)x/g, '$1X'); //Fix various ISSN craziness str = str.replace(/(issn\s*=\s*\d\d\d\d)=(\d\d\d\d)/gi, '$1-$2'); str = str.replace(/(issn\s*=\s*\d\d\d\d)–(\d\d\d\d)/gi, '$1-$2'); str = str.replace(/(issn\s*=\s*\d\d\d\d)—(\d\d\d\d)/gi, '$1-$2'); //Billboard USA ISSN str = str.replace(/issn\s*=\s*0005-*2510/gi, 'issn=0006-2510'); str = str.replace(/issn\s*=\s*006-*2510/gi, 'issn=0006-2510'); //Super Play ISSN str = str.replace(/issn\s*=\s*0966-*6199/gi, 'issn=0966-6192');

return str; }