User:Ramesh Ramaiah/script/Sources.js

/************* mw.loader.load('https://meta.wikimedia.org/w/index.php?title=User:Pathoschild/Scripts/Regex_menu_framework.js&action=raw&ctype=text/javascript'); function Ohc_linkspam { var txt=document.editform.wpTextbox1; txt.value=txt.value.replace(/([^>\*][ ]?)\[https?:\/\/[^\s\]]*[ ]([\w\d][^\]]*)\](?![ ]*[\n\-]+)/gi, '$1$2'); }
 * This script is considered OBSOLETE
 * It is retained for historical purposes and for IE8 users (who face compatibility issues with the new version of the script)
 * It will no longer be maintained except for bug-fixing

function Ohc_sources_prep { var txt=document.editform.wpTextbox1; // removing references to other WP articles txt.value=txt.value.replace(/ https?:\/\/en\.wikipedia\.org\/wiki\/[^\s\]<]*<\/ref>/gi, ''); txt.value=txt.value.replace(/ \[https?:\/\/en\.wikipedia\.org\/wiki\/[^\s\]]*[ ][\w\d][^\]]*\]<\/ref>/gi, '');

// removing external links within publisher/journal/work fields txt.value=txt.value.replace(/(\|\s?(?:newspaper|work|journal|publisher)\s?\=\s?)\[https?:\/\/[^\s\]]*\s([\w\d][^\]]*)\]/gi, '$1$2'); txt.value=txt.value.replace(/(\|\s?(?:newspaper|work|journal|publisher)\s?\=\s?)www\.([\w\d][^\|\}]*)(?=[\|\}])/gi, '$1$2'); //		txt.value=txt.value.replace(/\{\{[ ]*cite /g, '{{Cite '); txt.value=txt.value.replace(/\{\{wikinews(|2|cat|has|portal|table|-inline)(\|[^\}]+|)\}\}\s*/gi, ''); txt.value=txt.value.replace(/\*[ ]*\{\{Find a Grave\|\d{4}(\|[^\}]+|)\}\}\s*/gi, ''); //citation template fixes // rem copyright assertion txt.value=txt.value.replace(/(\|\s?publisher\s?\=\s?)(?:©|copyright|\[\[copyright(?:\|©|)\]\])\s?/gi, '$1');

txt.value=txt.value.replace(/(?:\|\s?publisher\s?\=\s?\'\'\[\[([^\]]{1,40})\]\]\'\')/gi, '|work=$1'); txt.value=txt.value.replace(/(?:\|\s?publisher\s?\=\s?\'\'([^\|\}]{1,40})\'\')/gi, '|work=$1'); txt.value=txt.value.replace(/(?:\|\s?(?:newspaper|work)\s?\=\s?\'\'\[\[([^\]]{1,40})\]\]\'\')/gi, '|publisher=$1'); txt.value=txt.value.replace(/(?:\|\s?(?:newspaper|work)\s?\=\s?\'\'([^\|\}]{1,40})\'\')/gi, '|publisher=$1'); txt.value=txt.value.replace(/(\|\s?title\s?\=\s?)["“]([^\|]+)["”](?=\s?[\|\}])/gi, '$1$2'); txt.value=txt.value.replace(/(\|\s?title\s?\=\s?)['‘]([^\|]+)['’](?=\s?[\|\}])/gi, '$1$2'); // removing blank parameters regex(/(?:\|[ ]*(?:first\d?|agency|(?:co|)authors?\d?|archive(?:url|date)|journal|publisher|newspaper|work|(?:access|)date|doi|month|year|location|format|language|last\d?|publisher|authorlink\d?|volume|issue|pages?|firstn|lastn|authorn-link|editor|editorn|editorn-last|editorn-first|editor-link|editorn-link|others|nopp|chapter|trans_chapter|chapterurl|quote|ref|laysummary|laydate|separator|postscript|lastauthoramp|issn|oclc|pmid|pmd|bibcode|id)[ ]*=[\s]*)(?=[\}\|])/gi, '');

//rem underlining within certain fields txt.value=txt.value.replace(/(\|\s?(?:journal|newspaper|periodical|publisher|work)\s?\=\s?) ([^\|\}]*)<\/u>/gi, '$1');

//rem linking within locations field regex(/(\|[ ]*?location=[ ]*?)\[\[([^\|\]]+?)\]\](?:(,? )\[\[([^\|\]]+?)\]\]|)([ ]{0,1})/gi, '$1$2$3$4$5'); regex(/(\|[ ]*?location=[ ]*?)\[\[(?:[^\|\]]+?\|)([\w\s\,]+?)\]\](?:(,? )\[\[([^\|\]]+?)\]\]|)([ ]{0,1})/gi, '$1$2$3$4$5');

}

function Ohc_dab_news_sources { var txt=document.editform.wpTextbox1;

//pre-dab of piped sources //        regex(/(\[\[)(?:foo|bar)(\|)/gi, '$1foo bar \(dab\)$2');

regex(/(\[\[)(?:(?:British|English|London) Sun|Sun on Sunday|The Scottish Sun|(?:The |)Sun (?:\((?:British |)newspaper\)|\(tabloid\)|\(UK newspaper\)|\(UK\)|Newspaper|on Sunday|Online)|Thesun\.co\.uk)(\|)/gi, '$1The Sun \(United Kingdom\)$2'); regex(/(\[\[)Daily Star \((?:British|UK)\)(\|)/gi, '$1Daily Star \(United Kingdom\)$2'); regex(/(\[\[)(?:Calcutta Telegraph|The Telegraph \((?:kolkatt?a|India)\)|The Telegraph India)(\|)/gi, '$1The Telegraph \(Calcutta\)$2');

regex(/((?:journal|newspaper|periodical|work)\s?=\s?\[\[(Daily News) \(New York\)\|)(?:[\w,]*)(\]\])/gi, '$1$2$3 |location=New York'); regex(/(?:author|agency|publisher)(\s?=\s?\[\[(Daily News) \(New York\)\|)(?:[\w,]*)(\]\])/gi, 'work$1$2$3 |location=New York'); regex(/((?:journal|newspaper|periodical|work)\s?=\s?\[\[(The Sun|Daily Star) \((United Kingdom)\)\|)(?:[\w,]*)(\]\])/gi, '$1$2$4 |location=$3'); regex(/(?:author|agency|publisher)(\s?=\s?\[\[(The Sun|Daily Star) \((United Kingdom)\)\|)(?:[\w,]*)(\]\])/gi, 'work$1$2$4 |location=$3'); regex(/((?:journal|newspaper|periodical|work)\s?=\s?\[\[(The Telegraph) \(Calcutta\)\|)(?:[\w,]*)(\]\])/gi, '$1$2$4 |location=$3'); regex(/((?:author|agency|publisher)\s?\=\s?\[\[(The Telegraph) \(Calcutta\)\|)(?:[\w,]*)(\]\])/gi, 'work$1$2$4 |location=$3');

regex(/((?:journal|newspaper|periodical|work)\s?=\s?\[\[(Evening Standard)\|)(?:[\w,]*)(\]\])/gi, '$1$2$3 |location=London'); regex(/(?:author|agency|publisher)(\s?=\s?\[\[(Evening Standard))\|[\w,]*(\]\])/gi, 'work$1$2$3|location=London');

regex(/(?:\|\s?(?:work|publisher)\s?\=\s?)(?:\[\[The Pioneer \(Indian newspaper\)\|(The Pioneer)\]\])(?=[\s\.]*[\|\}])/gi, '|work=$1 |location=India');  //

}

function Ohc_news_sources { var txt=document.editform.wpTextbox1; //	txt.value=txt.value.replace(/\[\[Time\s\(magazine\)\|(Time|Time Magazine)\]\]/g, 'Time'); //	txt.value=txt.value.replace(/\[\[Billboard\s\(magazine\)\|(Billboard|Billboard Magazine)\]\]/g, '$1'); txt.value=txt.value.replace(/(The |)Globe (And|&) Mail/g, 'The Globe and Mail'); txt.value=txt.value.replace(/Chicago Sun(?:-?t|\s[Tt])imes/g, 'Chicago Sun-Times'); // txt.value=txt.value.replace(/\bny times\b/g, 'The New York Times'); txt.value=txt.value.replace(/\bla times\b/g, 'Los Angeles Times'); txt.value=txt.value.replace(/\b(Times) Of (India)\b/g, '$1 of $2'); //returns 'work=' for traditional media; delinks and dabs location txt.value=txt.value.replace(/\|\s?(?:work|publisher|newspaper|journal)\s?\=\s?(?:\[\[)?(?:(?:Christian Science Monitor|csmonitor\.com)(?:\]\])?)(?=[\s\.]*[\|\}])/gi, '|work=The Christian Science Monitor'); txt.value=txt.value.replace(/\|\s?(?:work|publisher)\s?\=\s?(?:\[\[)?(?:(?:the |)(National Post|Le Devoir|Le Droit)(?:\]\])?)(?=[\s\.]*[\|\}])/gi, '|work=$1 |location=Canada'); txt.value=txt.value.replace(/\|\s?(?:work|publisher)\s?\=\s?(?:\[\[)?(?:(?:the |)(Globe and Mail)(?:\]\])?)(?=[\s\.]*[\|\}])/gi, '|work=$1 |location=Canada'); txt.value=txt.value.replace(/\|\s?(?:work|publisher)\s?\=\s?(?:\[\[)?(?:(?:the |)(Vancouver Sun)(?:\]\])?)(?=[\s\.]*[\|\}])/gi, '|work=$1'); txt.value=txt.value.replace(/\|\s?(?:work|publisher)\s?\=\s?(?:\[\[)?(?:(Winnipeg Free Press)(?:\]\])?)(?=[\s\.]*[\|\}])/gi, '|work=$1'); txt.value=txt.value.replace(/\|\s?(?:work|publisher)\s?\=\s?(?:\[\[)?(?:the )?((?:Sunday )?Times|Independent|Observer|Guardian|Scotsman|Spectator)(?:\]\])?(?=[\s\.]*[\|\}])/gi, '|work=The $1'); txt.value=txt.value.replace(/\|\s?(?:work|publisher|newspaper)\s?\=\s?\[\[(?:The |)Daily Telegraph(?:\|[^\]]*|)\]\](?=[\s\.]*[\|\}])/gi, '|work=The Daily Telegraph'); txt.value=txt.value.replace(/\|\s?(?:work|publisher)\s?\=\s?(?:\[\[)?(?:the )?(Daily (?:Mail|Mirror|Express)|NME|New Musical Express|New Statesman)(?:\]\])?(?=[\s\.]*[\|\}])/gi, '|work=$1'); txt.value=txt.value.replace(/\|\s?(?:work|publisher)\s?\=\s?(?:\[\[)?(?:The Sun|Daily Star) \((?:United Kingdom|newspaper)\)\|(The Sun|Daily Star)(?:\]\])?(?=[\s\.]*[\|\}])/gi, '|work=$1 '); txt.value=txt.value.replace(/\|\s?(?:work|publisher)\s?\=\s?(?:\[\[)?(apple daily|ming pao|The standard|south china morning post)(?:\]\])?(?=[\s\.]*[\|\}])/gi, '|work=$1'); txt.value=txt.value.replace(/(?:\|\s?(?:work|publisher)\s?\=\s?(?:\[\[)The standard\|[^\]]*(?:\]\]))(?=[\s\.]*[\|\}])/gi, '|work=The Standard'); txt.value=txt.value.replace(/(?:\|\s?(?:work|publisher)\s?\=\s?(?:\[\[)?(The Age|Herald Sun)(?:(?:\]\])?))(?=[\s\.]*[\|\}])/gi, '|work=$1 |location=Australia'); txt.value=txt.value.replace(/(?:\|\s?(?:work|publisher)\s?\=\s?(?:\[\[)?(Asahi Shimbun|Yomiuri Shimbun)(?:\]\])?)(?=[\s\.]*[\|\}])/gi, '|work=$1 '); txt.value=txt.value.replace(/(?:\|\s?(?:work|publisher)\s?\=\s?(?:\[\[)?(?:the |)(Irish |Japan |Taipei |Taiwan )Times(?:\]\])?)(?=[\s\.]*[\|\}])/gi, '|work=The $1Times '); txt.value=txt.value.replace(/(?:\|\s?(?:work|publisher)\s?\=\s?(?:\[\[)?(La Croix|Le Figaro|L'Humanité|Libération|Le Monde|Le Parisien|La Tribune|France Soir|Direct Matin|Direct Soir|L'Équipe|Le Canard enchaîné|Le Nouvel Observateur|L'Express|Le Point|Paris-Match|Télérama|Courrier International)(?:\]\])?)(?=[\s\.]*[\|\}])/gi, '|work=$1'); txt.value=txt.value.replace(/(?:\|\s?(?:work|publisher)\s?\=\s?(?:\[\[)?(Avvenire|Corriere della Sera|Il Fatto Quotidiano|Il Foglio|il Giornale|Il Giorno|il manifesto|Il Mattino|Il Messaggero|il Resto del Carlino|il Riformista|Il Secolo XIX|Il Tempo|La Nazione|la Repubblica|La Stampa|L'espresso|Corriere del Mezzogiorno)(?:\]\])?)(?=[\s\.]*[\|\}])/gi, '|work=$1'); txt.value=txt.value.replace(/(?:\|\s?(?:work|publisher)\s?\=\s?(?:\[\[)?(The |)(Deccan Herald|Deccan Chronicle|Times of India|Hindustan Times|Hindu|Indian Express|New Indian Express)(?:\]\])?)(?=[\s\.]*[\|\}])/gi, '|work=$1$2'); txt.value=txt.value.replace(/(?:\|\s?(?:work|publisher)\s?\=\s?(?:\[\[)?(The |)(Statesman|Daily News and Analysis|Economic Times|Tribune|Asian Age)(?:\]\])?)(?=[\s\.]*[\|\}])/gi, '|work=$1$2 |location=India'); txt.value=txt.value.replace(/(?:\|\s?(?:work|publisher)\s?\=\s?)(?:\[\[The Telegraph \(Kolkata\)\|(The Telegraph)\]\])(?=[\s\.]*[\|\}])/gi, '|work=$1 |location=Kolkota, India'); txt.value=txt.value.replace(/(?:\|\s?(?:work|publisher)\s?\=\s?)(?:\[\[The Pioneer \(Indian newspaper\)\|(The Pioneer)\]\])(?=[\s\.]*[\|\}])/gi, '|work=$1 |location=India'); txt.value=txt.value.replace(/(?:\|\s?(?:work|publisher)\s?\=\s?(?:\[\[)?(?:The |)((?:Indian|Financial) Express)(?:\]\])?)(?=[\s\.]*[\|\}])/gi, '|work=The $1'); txt.value=txt.value.replace(/(?:\|\s?(?:work|publisher)\s?\=\s?(?:\[\[)?(Blesk|Hospodářské noviny|Lidové noviny|Mladá fronta DNES|Právo|(?:The |)Prague Post)(?:\]\])?)(?=[\s\.]*[\|\}])/gi, '|work=$1 |location=Czech Republic');

txt.value=txt.value.replace(/(?:\|\s?publisher\s?\=\s?(the |)((sunday )?Times|daily (mail|mirror|express)|(?:London |)Evening Standard|independent|observer|guardian|NME|New Musical Express|New Statesman|Scotsman|Spectator|Daily Telegraph))(?=[\s\.]*[\|\}])/gi, '|work=$1$2'); txt.value=txt.value.replace(/(?:\|\s?(?:work|publisher)(\s?\=\s?(?:\[\[)?)(?:the |)jakarta post(\]\]|))(?=[\s\.]*[\|\}])/gi, '|work$1The Jakarta Post$2'); txt.value=txt.value.replace(/(?:\|\s?(?:work|publisher)(\s?\=\s?(?:\[\[)?)(?:the |)jakarta globe(\]\]|))(?=[\s\.]*[\|\}])/gi, '|work$1Jakarta Globe$2'); txt.value=txt.value.replace(/(?:\|\s?(?:work|publisher)(\s?\=\s?(?:\[\[)?)(?:The |)Straits Times(\]\]|))(?=[\s\.]*[\|\}])/gi, '|work$1Straits Times$2'); txt.value=txt.value.replace(/(?:\|\s?(?:work|publisher)(\s?\=\s?(?:\[\[)?)(China Times|Liberty Times|(?:The |)China Post|United Daily News)(\]\]|))(?=[\s\.]*[\|\}])/gi, '|work$1$2$3'); txt.value=txt.value.replace(/(?:\|\s?publisher(\s?\=\s?)(apple daily|ming pao))(?=[\s\.]*[\|\}])/gi, '|work$1$2'); txt.value=txt.value.replace(/(?:\|\s?publisher(\s?\=\s?\[\[The standard\|hk ?standard\]\]))(?=[\s\.]*[\|\}])/gi, '|work$1'); //	txt.value=txt.value.replace(/(?:\|\s?publisher\s?\=\s?the age)(?=[\s\.]*[\|\}])/gi, '|work$1The Age$2'); txt.value=txt.value.replace(/(?:\|\s?(?:work|publisher)(\s?\=\s?(?:\[\[)?)(?:nz |new zealand )herald(\]\]|))(?=[\s\.]*[\|\}])/gi, '|work$1The New Zealand Herald$2');

regex(/(\|publisher=)(Turner Sports Interactive, Inc)\.? ?\|(?:publisher|work)=(NBA)(?:\.com|) ?\|/gi, '$1$3/$2. |'); regex(/(\|(?:publisher|work)=)(NBA)(?:\.com|) ?\|publisher=(Turner Sports Interactive, Inc)\.? ?\|/gi, '$1$2/$3. |'); txt.value=txt.value.replace(/(?:\|\s?(?:work|publisher)(\s?\=\s?(?:\[\[)?)([\w]+\.)nbcsports\.com(\]\]|))(?=[\s\.]*[\|\}])/gi, '|publisher$1NBC Sports$2'); txt.value=txt.value.replace(/(?:\|\s?(?:work|publisher)(\s?\=\s?(?:\[\[)?)cricinfo\.com(\]\]|))(?=[\s\.]*[\|\}])/gi, '|publisher$1ESPNcricinfo$2'); txt.value=txt.value.replace(/(?:\|\s?(?:work|publisher)(\s?\=\s?(?:\[\[)?)goal\.com(\]\]|))(?=[\s\.]*[\|\}])/gi, '|work=Goal'); txt.value=txt.value.replace(/(?:\|\s?(?:work|publisher)(\s?\=\s?(?:\[\[)?)uefa\.com(\]\]|))(?=[\s\.]*[\|\}])/gi, '|publisher$1UEFA$2'); txt.value=txt.value.replace(/(?:\|\s?(?:work|publisher)(\s?\=\s?(?:\[\[)?)nba\.com(\]\]|))(?=[\s\.]*[\|\}])/gi, '|publisher$1NBA$2'); txt.value=txt.value.replace(/(?:\|\s?(?:work|publisher)(\s?\=\s?(?:\[\[)?)nfl\.com(\]\]|))(?=[\s\.]*[\|\}])/gi, '|publisher$1NFL$2'); txt.value=txt.value.replace(/(?:\|\s?(?:work|publisher)(\s?\=\s?(?:\[\[)?)(?:fr\.|de\.|)fifa\.com(\]\]|))(?=[\s\.]*[\|\}])/gi, '|publisher$1FIFA$2');

//returns 'work=' for traditional media with websites txt.value=txt.value.replace(/(?:\|\s?(?:publisher)(\s?\=\s?(?:\[\[)?)(Wired \(magazine\)\|Wired)(\]\]|))(?=[\s\.]*[\|\}])/gi, '|work$1$2$3'); txt.value=txt.value.replace(/(?:\|\s?(?:work|publisher)(\s?\=\s?(?:\[\[)?)(?:wired(?:\.com|))(\]\]|))(?=[\s\.]*[\|\}])/gi, '|work$1Wired$2'); txt.value=txt.value.replace(/(?:\|\s?(?:work|publisher)(\s?\=\s?(?:\[\[)?)(?:flightglobal\.com|Flight Global)(\]\]|))(?=[\s\.]*[\|\}])/gi, '|work$1Flight International$2'); txt.value=txt.value.replace(/(?:\|\s?(?:work|publisher)(\s?\=\s?(?:\[\[)?)playbill.com(\]\]|))(?=[\s\.]*[\|\}])/gi, '|work$1Playbill$2'); txt.value=txt.value.replace(/(?:\|\s?(?:work|publisher)(\s?\=\s?(?:\[\[)?)(?:variety.com|Variety \(magazine\)\|Variety)(\]\]|))(?=[\s\.]*[\|\}])/gi, '|work$1Variety$2'); txt.value=txt.value.replace(/(?:\|\s?(?:publisher)(\s?\=\s?(?:\[\[)?)(Vogue \(magazine\)\|Vogue)(\]\]|))(?=[\s\.]*[\|\}])/gi, '|work$1$2$3'); txt.value=txt.value.replace(/(?:\|\s?(?:work|publisher)(\s?\=\s??)(?:vogue.com))(?=[\s\.]*[\|\}])/gi, '|work$1Vogue'); txt.value=txt.value.replace(/(?:\|\s?(?:publisher)(\s?\=\s?(?:\[\[)?)(Vanity Fair \(magazine\)\|Vanity Fair)(\]\]|))(?=[\s\.]*[\|\}])/gi, '|work$1$2$3'); txt.value=txt.value.replace(/(?:\|\s?(?:work|publisher)(\s?\=\s??)(?:vanityfair.com))(?=[\s\.]*[\|\}])/gi, '|work$1Vanity Fair'); txt.value=txt.value.replace(/(?:\|\s?(?:work|publisher)(\s?\=\s?(?:\[\[)?)empireonline.com(\]\]|))(?=[\s\.]*[\|\}])/gi, '|work$1Empire$2'); txt.value=txt.value.replace(/(?:\|\s?(?:work|publisher)(\s?\=\s?(?:\[\[)?)(?:hollywoodreporter.com|(?:The |)Hollywood Reporter)(\]\]|))(?=[\s\.]*[\|\}])/gi, '|work$1The Hollywood Reporter$2'); txt.value=txt.value.replace(/(?:\|\s?(?:work|publisher)(\s?\=\s?(?:\[\[)?)nme\.com(\]\]|))(?=[\s\.]*[\|\}])/gi, '|work$1NME$2'); txt.value=txt.value.replace(/(?:\|\s?(?:work|publisher)(\s?\=\s?(?:\[\[)?)qthemusic\.com(\]\]|))(?=[\s\.]*[\|\}])/gi, '|work$1Q$2'); txt.value=txt.value.replace(/(?:\|\s?(?:work|publisher)(\s?\=\s?(?:\[\[)?)billboard\.com(\]\]|))(?=[\s\.]*[\|\}])/gi, '|work$1Billboard$2'); txt.value=txt.value.replace(/(?:\|\s?(?:work|publisher)(\s?\=\s?(?:\[\[)?)(?:rollingstone.com|Rolling Stone magazine)(\]\]|))(?=[\s\.]*[\|\}])/gi, '|work$1Rolling Stone$2'); txt.value=txt.value.replace(/(?:\|\s?(?:work|publisher)(\s?\=\s?(?:\[\[)?)bmj\.com(\]\]|))(?=[\s\.]*[\|\}])/gi, '|work$1BMJ$2'); txt.value=txt.value.replace(/(?:\|\s?(?:work|publisher)(\s?\=\s?(?:\[\[)?)thelancet\.com(\]\]|))(?=[\s\.]*[\|\}])/gi, '|work$1The Lancet$2'); txt.value=txt.value.replace(/(?:\|\s?(?:work|publisher)(\s?\=\s?(?:\[\[)?)nature\.com(\]\]|))(?=[\s\.]*[\|\}])/gi, '|work$1Nature$2'); txt.value=txt.value.replace(/(?:\|\s?(?:work|publisher)(\s?\=\s?(?:\[\[)?)science\.com(\]\]|))(?=[\s\.]*[\|\}])/gi, '|work$1Science$2'); txt.value=txt.value.replace(/(?:\|\s?(?:work|publisher)(\s?\=\s?(?:\[\[)?)(?:scientificamerican\.com|Scientific American)(\]\]|))(?=[\s\.]*[\|\}])/gi, '|work$1Scientific American$2'); txt.value=txt.value.replace(/(?:\|\s?(?:work|publisher)(\s?\=\s?(?:\[\[)?)(?:newscientist\.com|new scientist)(\]\]|))(?=[\s\.]*[\|\}])/gi, '|work$1New Scientist$2'); txt.value=txt.value.replace(/(?:\|\s?(?:work|publisher)(\s?\=\s?(?:\[\[)?)(?:Medicalnewstoday\.com|Medical News Today)(\]\]|))(?=[\s\.]*[\|\}])/gi, '|work$1Medical News Today$2'); txt.value=txt.value.replace(/(?:\|\s?(?:work|publisher)(\s?\=\s?(?:\[\[)?)(?:publishersweekly.com|Publishers Weekly)(\]\]|))(?=[\s\.]*[\|\}])/gi, '|work$1Publishers Weekly$2');

txt.value=txt.value.replace(/(?:\|\s?(?:work|publisher)(\s?\=\s?(?:\[\[)?)abc\.(com\.au|net(?:\.au|))(\]\]|))(?=[\s\.]*[\|\}])/gi, '|publisher$1ABC$2'); txt.value=txt.value.replace(/(?:\|\s?(?:work|publisher)(\s?\=\s?(?:\[\[)?)abc\.com(\]\]|))(?=[\s\.]*[\|\}])/gi, '|publisher$1ABC$2'); txt.value=txt.value.replace(/(?:\|\s?(?:work|publisher)(\s?\=\s?(?:\[\[)?)abcnews(?:\.go)?\.com(\]\]|))(?=[\s\.]*[\|\}])/gi, '|publisher$1ABC News$2'); txt.value=txt.value.replace(/(?:\|\s?(?:work|publisher)(\s?\=\s?(?:\[\[)?)cbc\.ca(\]\]|))(?=[\s\.]*[\|\}])/gi, '|publisher$1CBC$2'); txt.value=txt.value.replace(/(?:\|\s?(?:work|publisher)(\s?\=\s?(?:\[\[)?)boston.com(\]\]|))(?=[\s\.]*[\|\}])/gi, '|work$1Boston Globe$2'); txt.value=txt.value.replace(/(?:\|\s?(?:work|publisher)(\s?\=\s?(?:\[\[)?)businessweek\.com(\]\]|))(?=[\s\.]*[\|\}])/gi, '|work$1Bloomberg BusinessWeek$2'); txt.value=txt.value.replace(/(?:\|\s?(?:work|publisher)(\s?\=\s?(?:\[\[)?)chicagotribune\.com(\]\]|))(?=[\s\.]*[\|\}])/gi, '|work$1Chicago Tribune$2'); txt.value=txt.value.replace(/(?:\|\s?(?:work|publisher)(\s?\=\s?(?:\[\[)?)chinadaily\.com\.cn(\]\]|))(?=[\s\.]*[\|\}])/gi, '|work$1China Daily$2'); txt.value=txt.value.replace(/(?:\|\s?(?:work|publisher)(\s?\=\s?(?:\[\[)?)chinatimes\.com(\]\]|))(?=[\s\.]*[\|\}])/gi, '|work$1China Times |location=Taiwan (ROC)$2'); txt.value=txt.value.replace(/(?:\|\s?(?:work|publisher)(\s?\=\s?(?:\[\[)?)libertytimes\.com\.tw(\]\]|))(?=[\s\.]*[\|\}])/gi, '|work$1Liberty Times$2'); txt.value=txt.value.replace(/(?:\|\s?(?:work|publisher)(\s?\=\s?(?:\[\[)?)taipeitimes\.com(\]\]|))(?=[\s\.]*[\|\}])/gi, '|work$1Taipei Times$2'); txt.value=txt.value.replace(/(?:\|\s?(?:work|publisher)(\s?\=\s?(?:\[\[)?)udn\.com(\]\]|))(?=[\s\.]*[\|\}])/gi, '|work$1United Daily News$2'); txt.value=txt.value.replace(/(?:\|\s?(?:work|publisher)(\s?\=\s?(?:\[\[)?)[^\]]{0,40}people(?:daily|)\.com\.cn(\]\]|))(?=[\s\.]*[\|\}])/gi, '|work$1People\'s Daily$2'); txt.value=txt.value.replace(/(?:\|\s?(?:work|publisher)(\s?\=\s?(?:\[\[)?)straitstimes\.com(\]\]|))(?=[\s\.]*[\|\}])/gi, '|work$1Straits Times$2'); txt.value=txt.value.replace(/(?:\|\s?(?:work|publisher)(\s?\=\s?(?:\[\[)?)chron\.com(\]\]|))(?=[\s\.]*[\|\}])/gi, '|work$1Houston Chronicle$2'); txt.value=txt.value.replace(/(?:\|\s?(?:work|publisher)(\s?\=\s?(?:\[\[)?)(?:dailymail.co\.uk|Mail Online)(\]\]|))(?=[\s\.]*[\|\}])/gi, '|work$1Daily Mail$2'); txt.value=txt.value.replace(/(?:\|\s?(?:work|publisher)(\s?\=\s?(?:\[\[)?)mirror.co\.uk(\]\]|))(?=[\s\.]*[\|\}])/gi, '|work$1Daily Mirror$2'); txt.value=txt.value.replace(/(?:\|\s?(?:work|publisher)(\s?\=\s?(?:\[\[)?)denverpost\.com(\]\]|))(?=[\s\.]*[\|\}])/gi, '|work$1Denver Post$2'); txt.value=txt.value.replace(/(?:\|\s?(?:work|publisher)(\s?\=\s?(?:\[\[)?)(?:(?:der|)spiegel\.de|spiegel online)(\]\]|))(?=[\s\.]*[\|\}])/gi, '|work$1Der Spiegel$2'); txt.value=txt.value.replace(/(?:\|\s?(?:work|publisher)(\s?\=\s?(?:\[\[)?)((?:die|)welt\.de|welt online)(\]\]|))(?=[\s\.]*[\|\}])/gi, '|work$1Die Welt$2'); txt.value=txt.value.replace(/(?:\|\s?(?:work|publisher)(\s?\=\s?(?:\[\[)?)economist\.com(\]\]|))(?=[\s\.]*[\|\}])/gi, '|work$1The Economist$2'); txt.value=txt.value.replace(/(?:\|\s?(?:work|publisher)(\s?\=\s?(?:\[\[)?)[\w\.]*\.ew.com(\]\]|))(?=[\s\.]*[\|\}])/gi, '|work$1Entertainment Weekly$2'); txt.value=txt.value.replace(/(?:\|\s?(?:work|publisher)(\s?\=\s?(?:\[\[)?)[\w\.]*forbes\.com(\]\]|))(?=[\s\.]*[\|\}])/gi, '|work$1Forbes$2'); txt.value=txt.value.replace(/(?:\|\s?(?:work|publisher)(\s?\=\s?(?:\[\[)?)radiotimes\.com(\]\]|))(?=[\s\.]*[\|\}])/gi, '|work$1Radio Times$2'); txt.value=txt.value.replace(/(?:\|\s?(?:work|publisher)(\s?\=\s?(?:\[\[)?)ft.com(\]\]|))(?=[\s\.]*[\|\}])/gi, '|work$1Financial Times$2'); txt.value=txt.value.replace(/(?:\|\s?(?:work|publisher)(\s?\=\s?(?:\[\[)?)Guardian(?:\.co\.uk|\sUnlimited)(\]\]|))(?=[\s\.]*[\|\}])/gi, '|work$1The Guardian$2'); txt.value=txt.value.replace(/(?:\|\s?(?:work|publisher)(\s?\=\s?(?:\[\[)?)(Hello|OK)magazine\.com(\]\]|))(?=[\s\.]*[\|\}])/gi, '|work$1$2!$3'); txt.value=txt.value.replace(/(?:\|\s?(?:work|publisher)(\s?\=\s?(?:\[\[)?)iht\.com(\]\]|))(?=[\s\.]*[\|\}])/gi, '|work$1International Herald Tribune$2'); txt.value=txt.value.replace(/(?:\|\s?(?:work|publisher)(\s?\=\s?(?:\[\[)?)[\w\.]*independent\.co\.uk(\]\]|))(?=[\s\.]*[\|\}])/gi, '|work$1The Independent$2'); txt.value=txt.value.replace(/(?:\|\s?(?:work|publisher)(\s?\=\s?(?:\[\[)?)independent\.ie(\]\]|))(?=[\s\.]*[\|\}])/gi, '|work$1The Irish Independent$2'); txt.value=txt.value.replace(/(?:\|\s?(?:work|publisher)(\s?\=\s?(?:\[\[)?)irishtimes\.com(\]\]|))(?=[\s\.]*[\|\}])/gi, '|work$1The Irish Times$2'); txt.value=txt.value.replace(/(?:\|\s?(?:work|publisher)(\s?\=\s?(?:\[\[)?)[\w\.]*latimes\.com(\]\]|))(?=[\s\.]*[\|\}])/gi, '|work$1Los Angeles Times$2'); txt.value=txt.value.replace(/(?:\|\s?(?:work|publisher)(\s?\=\s?(?:\[\[)?)lefigaro\.fr(\]\]|))(?=[\s\.]*[\|\}])/gi, '|work$1Le Figaro$2'); txt.value=txt.value.replace(/(?:\|\s?(?:work|publisher)(\s?\=\s?(?:\[\[)?)lemonde\.fr(\]\]|))(?=[\s\.]*[\|\}])/gi, '|work$1Le Monde$2'); txt.value=txt.value.replace(/(?:\|\s?(?:work|publisher)(\s?\=\s?(?:\[\[)?)liberation.fr(\]\]|))(?=[\s\.]*[\|\}])/gi, '|work$1Libération$2'); txt.value=txt.value.replace(/(?:\|\s?(?:work|publisher)(\s?\=\s?(?:\[\[)?)La-Croix\.com(\]\]|))(?=[\s\.]*[\|\}])/gi, '|work$1La Croix$2'); txt.value=txt.value.replace(/(?:\|\s?(?:work|publisher)(\s?\=\s?(?:\[\[)?)LeParisien\.com(\]\]|))(?=[\s\.]*[\|\}])/gi, '|work$1Le Parisien$2'); txt.value=txt.value.replace(/(?:\|\s?(?:work|publisher)(\s?\=\s?(?:\[\[)?)LaTribune\.fr(\]\]|))(?=[\s\.]*[\|\}])/gi, '|work$1La Tribune$2'); txt.value=txt.value.replace(/(?:\|\s?(?:work|publisher)(\s?\=\s?(?:\[\[)?)Lesechos\.fr(\]\]|))(?=[\s\.]*[\|\}])/gi, '|work$1Les Échos$2'); txt.value=txt.value.replace(/(?:\|\s?(?:work|publisher)(\s?\=\s?(?:\[\[)?)Strategies\.fr(\]\]|))(?=[\s\.]*[\|\}])/gi, '|work$1Stratégies$2'); txt.value=txt.value.replace(/(?:\|\s?(?:work|publisher)(\s?\=\s?(?:\[\[)?)FranceSoir\.fr(\]\]|))(?=[\s\.]*[\|\}])/gi, '|work$1France Soir$2'); txt.value=txt.value.replace(/(?:\|\s?(?:work|publisher)(\s?\=\s?(?:\[\[)?)20Minutes\.fr(\]\]|))(?=[\s\.]*[\|\}])/gi, '|work$120 Minutes$2'); txt.value=txt.value.replace(/(?:\|\s?(?:work|publisher)(\s?\=\s?(?:\[\[)?)Lequipe\.fr(\]\]|))(?=[\s\.]*[\|\}])/gi, '|work$1L\'Équipe$2'); txt.value=txt.value.replace(/(?:\|\s?(?:work|publisher)(\s?\=\s?(?:\[\[)?)(?:le|)canardenchaine\.(?:com|fr)(\]\]|))(?=[\s\.]*[\|\}])/gi, '|work$1Le Canard Enchaîné$2'); txt.value=txt.value.replace(/(?:\|\s?(?:work|publisher)(\s?\=\s?(?:\[\[)?)NouvelObs\.com(\]\]|))(?=[\s\.]*[\|\}])/gi, '|work$1Le Nouvel Observateur$2'); txt.value=txt.value.replace(/(?:\|\s?(?:work|publisher)(\s?\=\s?(?:\[\[)?)Lexpress\.fr(\]\]|))(?=[\s\.]*[\|\}])/gi, '|work$1L\'Express$2'); txt.value=txt.value.replace(/(?:\|\s?(?:work|publisher)(\s?\=\s?(?:\[\[)?)LePoint\.fr(\]\]|))(?=[\s\.]*[\|\}])/gi, '|work$1Le Point$2'); txt.value=txt.value.replace(/(?:\|\s?(?:work|publisher)(\s?\=\s?(?:\[\[)?)marianne-en-ligne\.fr(\]\]|))(?=[\s\.]*[\|\}])/gi, '|work$1Marianne$2'); txt.value=txt.value.replace(/(?:\|\s?(?:work|publisher)(\s?\=\s?(?:\[\[)?)parismatch\.com(\]\]|))(?=[\s\.]*[\|\}])/gi, '|work$1Paris-Match$2'); txt.value=txt.value.replace(/(?:\|\s?(?:work|publisher)(\s?\=\s?(?:\[\[)?)Telerama\.fr(\]\]|))(?=[\s\.]*[\|\}])/gi, '|work$1Télérama$2'); txt.value=txt.value.replace(/(?:\|\s?(?:work|publisher)(\s?\=\s?(?:\[\[)?)Courrierinternational\.com(\]\]|))(?=[\s\.]*[\|\}])/gi, '|work$1Courrier International$2'); txt.value=txt.value.replace(/(?:\|\s?(?:work|publisher)(\s?\=\s?(?:\[\[)?)minute-hebdo\.fr(\]\]|))(?=[\s\.]*[\|\}])/gi, '|work$1Minute$2'); txt.value=txt.value.replace(/(?:\|\s?(?:work|publisher)(\s?\=\s?(?:\[\[)?)[\w\.]*corriere\.it(\]\]|))(?=[\s\.]*[\|\}])/gi, '|work$1Corriere della Sera$2');

regex(/(?:\|\s?(?:work|publisher|newspaper)(\s?\=\s?(?:\[\[)?)asahi\.com(\]\]|))(?=[\s\.]*[\|\}])/gi, '|work$1Asahi Shimbun$2'); regex(/(?:\|\s?(?:work|publisher|newspaper)(\s?\=\s?(?:\[\[)?)yomiuri(?:\.co\.jp| online|)(\]\]|))(?=[\s\.]*[\|\}])/gi, '|work$1Yomiuri Shimbun$2'); regex(/(?:\|\s?(?:work|publisher|newspaper)(\s?\=\s?(?:\[\[)?)[\w\.]*japantimes\.co\.jp(\]\]|))(?=[\s\.]*[\|\}])/gi, '|work$1Japan Times$2'); regex(/(?:\|\s?(?:work|publisher)(\s?\=\s?(?:\[\[)?)haaretz\.?(?:com|co\.il)(\]\]|))(?=[\s\.]*[\|\}])/gi, '|work$1Haaretz$2'); regex(/(?:\|\s?(?:work|publisher)(\s?\=\s?(?:\[\[)?)[\|]{0,14}hurriyet(?:dailynews|)\.?com(?:\.tr|)(\]\]|))(?=[\s\.]*[\|\}])/gi, '|work$1Hurriyet Daily News$2'); regex(/(?:\|\s?(?:work|publisher|newspaper)(\s?\=\s?(?:\[\[)?)thejakartapost\.(?:com|)(\]\]|))(?=[\s\.]*[\|\}])/gi, '|work$1The Jakarta Post$2'); regex(/(?:\|\s?(?:work|publisher|newspaper)(\s?\=\s?(?:\[\[)?)thejakartaglobe\.(?:com|)(\]\]|))(?=[\s\.]*[\|\}])/gi, '|work$1Jakarta Globe$2'); regex(/(?:\|\s?(?:work|publisher|newspaper)(\s?\=\s?(?:\[\[)?)jpost\.(com|co\.il)(\]\]|))(?=[\s\.]*[\|\}])/gi, '|work$1Jerusalem Post$2');

regex(/(?:\|\s?(?:work|publisher|newspaper)(\s?\=\s?(?:\[\[)?)Telegraphindia.com(\]\]|))(?=[\s\.]*[\|\}])/gi, '|work$1The Telegraph (Calcutta)$2'); regex(/(?:\|\s?(?:work|publisher|newspaper)(\s?\=\s?(?:\[\[)?)[\|]{0,14}Timesofindia\.(?:indiatimes\.|)com(\]\]|))(?=[\s\.]*[\|\}])/gi, '|work$1The Times of India$2'); regex(/(?:\|\s?(?:work|publisher|newspaper)(\s?\=\s?(?:\[\[)?)Hindustantimes\.com(\]\]|))(?=[\s\.]*[\|\}])/gi, '|work$1Hindustan Times$2'); regex(/(?:\|\s?(?:work|publisher|newspaper)(\s?\=\s?(?:\[\[)?)express(?:india\.com| online)(\]\]|))(?=[\s\.]*[\|\}])/gi, '|work$1The Indian Express$2'); regex(/(?:\|\s?(?:work|publisher)(\s?\=\s?(?:\[\[)?)financialexpress(?:\.com|)(\]\]|))(?=[\s\.]*[\|\}])/gi, '|work$1The Financial Express$2'); regex(/(?:\|\s?(?:work|publisher)(\s?\=\s?(?:\[\[)?)(?:the)?hindu.com(\]\]|))(?=[\s\.]*[\|\}])/gi, '|work$1The Hindu$2'); regex(/(?:\|\s?(?:work|publisher)(\s?\=\s?(?:\[\[)?)deccanchronicle.com(\]\]|))(?=[\s\.]*[\|\}])/gi, '|work$1The Deccan Chronicle$2'); regex(/(?:\|\s?(?:work|publisher)(\s?\=\s?(?:\[\[)?)Thestatesman.net(\]\]|))(?=[\s\.]*[\|\}])/gi, '|work$1The Statesman$2'); regex(/(?:\|\s?(?:work|publisher)(\s?\=\s?(?:\[\[)?)dailypioneer.com(\]\]|))(?=[\s\.]*[\|\}])/gi, '|work$1The Pioneer$2'); regex(/(?:\|\s?(?:work|publisher)(\s?\=\s?(?:\[\[)?)EconomicTimes.com(\]\]|))(?=[\s\.]*[\|\}])/gi, '|work$1The Economic Times |location=India'); regex(/(?:\|\s?(?:work|publisher)(\s?\=\s?(?:\[\[)?)tribuneindia.com(\]\]|))(?=[\s\.]*[\|\}])/gi, '|work$1The Tribune |location=India'); regex(/(?:\|\s?(?:work|publisher)(\s?\=\s?(?:\[\[)?)IndianExpress.com(\]\]|))(?=[\s\.]*[\|\}])/gi, '|work$1The Indian Express$2'); regex(/(?:\|\s?(?:work|publisher)(\s?\=\s?(?:\[\[)?)deccanherald.com(\]\]|))(?=[\s\.]*[\|\}])/gi, '|work$1Deccan Herald$2'); regex(/(?:\|\s?(?:work|publisher)(\s?\=\s?(?:\[\[)?)Expressbuzz.com(\]\]|))(?=[\s\.]*[\|\}])/gi, '|work$1The New Indian Express$2');

regex(/(?:\|\s?(?:work|publisher)(\s?\=\s?(?:\[\[)?)sunstar.com.ph(\]\]|))(?=[\s\.]*[\|\}])/gi, '|work$1Sun Star Cebu$2'); regex(/(?:\|\s?(?:work|publisher)(\s?\=\s?(?:\[\[)?)philstar.com(\]\]|))(?=[\s\.]*[\|\}])/gi, '|work$1The Philippine Star$2'); regex(/(?:\|\s?(?:work|publisher)(\s?\=\s?(?:\[\[)?)malaya.com.ph(\]\]|))(?=[\s\.]*[\|\}])/gi, '|work$1Malaya (newspaper)$2'); regex(/(?:\|\s?(?:work|publisher)(\s?\=\s?(?:\[\[)?)balitapinoy.net(\]\]|))(?=[\s\.]*[\|\}])/gi, '|work$1Balita Pinoy$2'); regex(/(?:\|\s?(?:work|publisher)(\s?\=\s?(?:\[\[)?)bantaybalita.150m.com(\]\]|))(?=[\s\.]*[\|\}])/gi, '|work$1Bohol Bantay Balita$2'); regex(/(?:\|\s?(?:work|publisher)(\s?\=\s?(?:\[\[)?)boholtimes.com(\]\]|))(?=[\s\.]*[\|\}])/gi, '|work$1Bohol Times$2'); regex(/(?:\|\s?(?:work|publisher)(\s?\=\s?(?:\[\[)?)bugso.tripod.com(\]\]|))(?=[\s\.]*[\|\}])/gi, '|work$1Bugso$2'); regex(/(?:\|\s?(?:work|publisher)(\s?\=\s?(?:\[\[)?)businessmirror.com.ph(\]\]|))(?=[\s\.]*[\|\}])/gi, '|work$1Business Mirror$2'); regex(/(?:\|\s?(?:work|publisher)(\s?\=\s?(?:\[\[)?)bworldonline.com(\]\]|))(?=[\s\.]*[\|\}])/gi, '|work$1BusinessWorld$2'); regex(/(?:\|\s?(?:work|publisher)(\s?\=\s?(?:\[\[)?)cebudailynews.com.ph(\]\]|))(?=[\s\.]*[\|\}])/gi, '|work$1Cebu Daily News$2'); regex(/(?:\|\s?(?:work|publisher)(\s?\=\s?(?:\[\[)?)dagupan.compunch(\]\]|))(?=[\s\.]*[\|\}])/gi, '|work$1Sunday Punch$2'); regex(/(?:\|\s?(?:work|publisher)(\s?\=\s?(?:\[\[)?)goldstar.sni.ph(\]\]|))(?=[\s\.]*[\|\}])/gi, '|work$1Mindanao Gold Star Daily$2'); regex(/(?:\|\s?(?:work|publisher)(\s?\=\s?(?:\[\[)?)inquirer.net(\]\]|))(?=[\s\.]*[\|\}])/gi, '|work$1Philippine Daily Inquirer$2'); regex(/(?:\|\s?(?:work|publisher)(\s?\=\s?(?:\[\[)?)maguindanawn.ning.com(\]\]|))(?=[\s\.]*[\|\}])/gi, '|work$1Maguindanao Network$2'); regex(/(?:\|\s?(?:work|publisher)(\s?\=\s?(?:\[\[)?)manilastandardtoday.com(\]\]|))(?=[\s\.]*[\|\}])/gi, '|work$1Manila Standard Today$2'); regex(/(?:\|\s?(?:work|publisher)(\s?\=\s?(?:\[\[)?)manilatimes.net(\]\]|))(?=[\s\.]*[\|\}])/gi, '|work$1The Manila Times$2'); regex(/(?:\|\s?(?:work|publisher)(\s?\=\s?(?:\[\[)?)mb.com.ph(\]\]|))(?=[\s\.]*[\|\}])/gi, '|work$1Manila Bulletin$2'); regex(/(?:\|\s?(?:work|publisher)(\s?\=\s?(?:\[\[)?)mindanaotimes.com.ph(\]\]|))(?=[\s\.]*[\|\}])/gi, '|work$1Mindanao Times$2'); regex(/(?:\|\s?(?:work|publisher)(\s?\=\s?(?:\[\[)?)moroinfo.com(\]\]|))(?=[\s\.]*[\|\}])/gi, '|work$1Moro Information Agency$2'); regex(/(?:\|\s?(?:work|publisher)(\s?\=\s?(?:\[\[)?)myph.com.ph(\]\]|))(?=[\s\.]*[\|\}])/gi, '|work$1myPH Online News$2'); regex(/(?:\|\s?(?:work|publisher)(\s?\=\s?(?:\[\[)?)newsflash.org(\]\]|))(?=[\s\.]*[\|\}])/gi, '|work$1Philippine Headline News$2'); regex(/(?:\|\s?(?:work|publisher)(\s?\=\s?(?:\[\[)?)philippinenews.com(\]\]|))(?=[\s\.]*[\|\}])/gi, '|work$1Philippine News$2'); regex(/(?:\|\s?(?:work|publisher)(\s?\=\s?(?:\[\[)?)pinoyparazzi.com(\]\]|))(?=[\s\.]*[\|\}])/gi, '|work$1Pinoy Parazzi$2'); regex(/(?:\|\s?(?:work|publisher)(\s?\=\s?(?:\[\[)?)sagad-bugso.tripod.com(\]\]|))(?=[\s\.]*[\|\}])/gi, '|work$1Sagad sa Impormasyon$2'); regex(/(?:\|\s?(?:work|publisher)(\s?\=\s?(?:\[\[)?)theboholchronicle.com(\]\]|))(?=[\s\.]*[\|\}])/gi, '|work$1Bohol Chronicle$2'); regex(/(?:\|\s?(?:work|publisher)(\s?\=\s?(?:\[\[)?)tribune.net.ph(\]\]|))(?=[\s\.]*[\|\}])/gi, '|work$1The Daily Tribune$2'); regex(/(?:\|\s?(?:work|publisher)(\s?\=\s?(?:\[\[)?)visayandailystar.com(\]\]|))(?=[\s\.]*[\|\}])/gi, '|work$1Visayan Daily Star$2'); regex(/(?:\|\s?(?:work|publisher)(\s?\=\s?(?:\[\[)?)zamboangatoday.ph(\]\]|))(?=[\s\.]*[\|\}])/gi, '|work$1Zamboanga Today Online$2');

regex(/(?:\|\s?(work|publisher)\s?\=\s?\[?\[?(?:as\.com)\]?\]?)(?=[\s\.]*[\|\}])/gi, '|work=AS '); regex(/(?:\|\s?(work|publisher)\s?\=\s?\[?\[?(?:Cinco Días|cincodias\.com)\]?\]?)(?=[\s\.]*[\|\}])/gi, '|work=Cinco Días '); regex(/(?:\|\s?(work|publisher)\s?\=\s?\[?\[?(?:El Economista|eleconomista\.es)\]?\]?)(?=[\s\.]*[\|\}])/gi, '|work=El Economista '); regex(/(?:\|\s?(work|publisher)\s?\=\s?\[?\[?(?:Estadio Deportivo|estadiodeportivo\.com)\]?\]?)(?=[\s\.]*[\|\}])/gi, '|work=Estadio Deportivo '); regex(/(?:\|\s?(work|publisher)\s?\=\s?\[?\[?(?:Expansión|expansion\.com)\]?\]?)(?=[\s\.]*[\|\}])/gi, '|work=Expansión '); regex(/(?:\|\s?(work|publisher)\s?\=\s?\[?\[?(?:La Gaceta de los Negocios|negocios\.(?:com|es))\]?\]?)(?=[\s\.]*[\|\}])/gi, '|work=La Gaceta de los Negocios '); regex(/(?:\|\s?(work|publisher)\s?\=\s?\[?\[?(?:Marca|marca\.com)\]?\]?)(?=[\s\.]*[\|\}])/gi, '|work=Marca '); regex(/(?:\|\s?(work|publisher)\s?\=\s?\[?\[?(?:Mundo Deportivo|elmundodeportivo\.(?:com|es))\]?\]?)(?=[\s\.]*[\|\}])/gi, '|work=Mundo Deportivo '); regex(/(?:\|\s?(work|publisher)\s?\=\s?\[?\[?(?:Noticias Bolsa|noticias-bolsa\.com)\]?\]?)(?=[\s\.]*[\|\}])/gi, '|work=Noticias Bolsa '); regex(/(?:\|\s?(work|publisher)\s?\=\s?\[?\[?(?:Negocio & Estilo de Vida|neg-ocio\.(?:com|es))\]?\]?)(?=[\s\.]*[\|\}])/gi, '|work=Negocio & Estilo de Vida '); regex(/(?:\|\s?(work|publisher)\s?\=\s?\[?\[?(?:Sport|sport\.es)\]?\]?)(?=[\s\.]*[\|\}])/gi, '|work=Sport '); regex(/(?:\|\s?(work|publisher)\s?\=\s?\[?\[?(?:Super Deporte|superdeporte\.(?:com|es))\]?\]?)(?=[\s\.]*[\|\}])/gi, '|work=Super Deporte '); regex(/(?:\|\s?(work|publisher)\s?\=\s?\[?\[?(?:20 Minutos|20minutos\.(?:com|es))\]?\]?)(?=[\s\.]*[\|\}])/gi, '|work=20 Minutos '); regex(/(?:\|\s?(work|publisher)\s?\=\s?\[?\[?(?:abc\.es)\]?\]?)(?=[\s\.]*[\|\}])/gi, '|work=ABC |location=Spain'); regex(/(?:\|\s?(work|publisher)\s?\=\s?\[?\[?(?:El Correo|elcorreo\.com)\]?\]?)(?=[\s\.]*[\|\}])/gi, '|work=El Correo '); regex(/(?:\|\s?(work|publisher)\s?\=\s?\[?\[?(?:El Mundo|elmundo\.(?:com|es))\]?\]?)(?=[\s\.]*[\|\}])/gi, '|work=El Mundo '); regex(/(?:\|\s?(work|publisher)\s?\=\s?\[?\[?(?:El País|[\w\.]*elpais\.(?:com|es))\]?\]?)(?=[\s\.]*[\|\}])/gi, '|work=El País '); regex(/(?:\|\s?(work|publisher)\s?\=\s?\[?\[?(?:El Periódico|elperiodicodearagon.com)\]?\]?)(?=[\s\.]*[\|\}])/gi, '|work=El Periódico '); regex(/(?:\|\s?(work|publisher)\s?\=\s?\[?\[?(?:La Razón|larazon\.(?:com|es))\]?\]?)(?=[\s\.]*[\|\}])/gi, '|work=La Razón '); regex(/(?:\|\s?(work|publisher)\s?\=\s?\[?\[?(?:La Vanguardia|lavanguardia\.(?:com|es))\]?\]?)(?=[\s\.]*[\|\}])/gi, '|work=La Vanguardia '); regex(/(?:\|\s?(work|publisher)\s?\=\s?\[?\[?(?:La Voz de Galicia|lavozdegalicia.com)\]?\]?)(?=[\s\.]*[\|\}])/gi, '|work=La Voz de Galicia '); regex(/(?:\|\s?(work|publisher)\s?\=\s?\[?\[?(?:Público|publico\.(?:com|es))\]?\]?)(?=[\s\.]*[\|\}])/gi, '|work=Público '); regex(/(?:\|\s?(work|publisher)\s?\=\s?\[?\[?(?:Qué!|quediario\.(?:com|es))\]?\]?)(?=[\s\.]*[\|\}])/gi, '|work=Qué! ');

regex(/(?:\|\s?(work|publisher)\s?\=\s?\[?\[?[\w\.]*blesk.cz\]?\]?)(?=[\s\.]*[\|\}])/gi, '|work=Blesk |location=Czech Republic'); regex(/(?:\|\s?(work|publisher)\s?\=\s?\[?\[?[\w\.]*ihned.cz\]?\]?)(?=[\s\.]*[\|\}])/gi, '|work=Hospodářské noviny |location=Czech Republic'); regex(/(?:\|\s?(work|publisher)\s?\=\s?\[?\[?[\w\.]*lidovky.cz\]?\]?)(?=[\s\.]*[\|\}])/gi, '|work=Lidové noviny |location=Czech Republic'); regex(/(?:\|\s?(work|publisher)\s?\=\s?\[?\[?[\w\.]*idnes.cz\]?\]?)(?=[\s\.]*[\|\}])/gi, '|work=Mladá fronta DNES |location=Czech Republic'); regex(/(?:\|\s?(work|publisher)\s?\=\s?\[?\[?pravo.novinky.cz\]?\]?)(?=[\s\.]*[\|\}])/gi, '|work=Právo |location=Czech Republic'); regex(/(?:\|\s?(work|publisher)\s?\=\s?\[?\[?praguepost.com\]?\]?)(?=[\s\.]*[\|\}])/gi, '|work=The Prague Post ');

regex(/(?:\|\s?(work|publisher)\s?\=\s?\[?\[?mingpao.com\]?\]?)(?=[\s\.]*[\|\}])/gi, '|work=Ming Pao '); regex(/(?:\|\s?(work|publisher)\s?\=\s?\[?\[?newsday\.com\]?\]?)(?=[\s\.]*[\|\}])/gi, '|work=Newsday |location=New York'); regex(/(?:\|\s?(work|publisher)\s?\=\s?\[?\[?newsweek\.com\]?\]?)(?=[\s\.]*[\|\}])/gi, '|work=Newsweek'); regex(/(?:\|\s?(work|publisher)\s?\=\s?\[?\[?nydailynews\.com\]?\]?)(?=[\s\.]*[\|\}])/gi, '|work=Daily News |location=New York'); regex(/(?:\|\s?(work|publisher)\s?\=\s?\[?\[?nypost.com\]?\]?)(?=[\s\.]*[\|\}])/gi, '|work=New York Post'); regex(/(?:\|\s?(work|publisher)\s?\=\s?\[?\[?[\w\.]*nytimes.com\]?\]?)(?=[\s\.]*[\|\}])/gi, '|work=The New York Times'); regex(/(?:\|\s?(work|publisher)\s?\=\s?\[?\[?[\w\.]*people.com\]?\]?)(?=[\s\.]*[\|\}])/gi, '|work=People'); regex(/(?:\|\s?(work|publisher)\s?\=\s?\[?\[?scmp.com\]?\]?)(?=[\s\.]*[\|\}])/gi, '|work=South China Morning Post |location=Hong Kong'); regex(/(?:\|\s?(work|publisher)\s?\=\s?\[?\[?[\w\.]*sfgate.com\]?\]?)(?=[\s\.]*[\|\}])/gi, '|work=San Francisco Chronicle'); regex(/(?:\|\s?(work|publisher)\s?\=\s?\[?\[?[\w\.]*smh\.com\.au\]?\]?)(?=[\s\.]*[\|\}])/gi, '|work=Sydney Morning Herald'); regex(/(?:\|\s?(work|publisher)\s?\=\s?\[?\[?spectator\.com\]?\]?)(?=[\s\.]*[\|\}])/gi, '|work=The Spectator '); regex(/(?:\|\s?(work|publisher)\s?\=\s?\[?\[?[\w\.]*scotsman\.com\]?\]?)(?=[\s\.]*[\|\}])/gi, '|work=The Scotsman '); regex(/(?:\|\s?(work|publisher)\s?\=\s?\[?\[?(?:thisis(?:london|money)\.co\.uk\|this is london)]?\]?)(?=[\s\.]*[\|\}])/gi, '|work=Evening Standard |location=London'); regex(/(?:\|\s?(work|publisher)\s?\=\s?\[?\[?manchester evening news\]?\]?)(?=[\s\.]*[\|\}])/gi, '|work=Manchester Evening News '); regex(/(?:\|\s?(work|publisher)\s?\=\s?\[?\[?sportsIllustrated\.cnn\.com\]?\]?)(?=[\s\.]*[\|\}])/gi, '|work=Sports Illustrated'); regex(/(?:\|\s?(work|publisher)\s?\=\s?\[?\[?thestandard\.com\.hk\]?\]?)(?=[\s\.]*[\|\}])/gi, '|work=The Standard |location=Hong Kong'); regex(/(?:\|\s?(?:work|publisher)\s?\=\s?(?:\[\[)?(chinapost\.com\.tw)(?:(?:\]\])?))(?=[\s\.]*[\|\}])/gi, '|work=China Post'); regex(/(?:\|\s?(work|publisher)\s?\=\s?\[?\[?thesun.co\.uk\]?\]?)(?=[\s\.]*[\|\}])/gi, '|work=The Sun '); regex(/(?:\|\s?(work|publisher)\s?\=\s?\[?\[?suntimes\.com\]?\]?)(?=[\s\.]*[\|\}])/gi, '|work=Chicago Sun-Times '); regex(/(?:\|\s?(work|publisher)\s?\=\s?\[?\[?telegraph\.co\.uk\]?\]?)(?=[\s\.]*[\|\}])/gi, '|work=The Daily Telegraph '); regex(/(?:\|\s?(work|publisher)\s?\=\s?\[?\[?dailytelegraph\.com\.au\]?\]?)(?=[\s\.]*[\|\}])/gi, '|work=The Daily Telegraph |location=Australia'); regex(/(?:\|\s?(work|publisher)\s?\=\s?\[?\[?theage\.com\.au\]?\]?)(?=[\s\.]*[\|\}])/gi, '|work=The Age |location=Australia'); regex(/(?:\|\s?(work|publisher)\s?\=\s?\[?\[?theaustralian\.com\.au\]?\]?)(?=[\s\.]*[\|\}])/gi, '|work=The Australian'); regex(/(?:\|\s?(work|publisher)\s?\=\s?\[?\[?nzherald\.co\.nz\]?\]?)(?=[\s\.]*[\|\}])/gi, '|work=The New Zealand Herald'); regex(/(?:\|\s?(work|publisher)\s?\=\s?\[?\[?theglobeandmail\.com\]?\]?)(?=[\s\.]*[\|\}])/gi, '|work=The Globe and Mail |location=Canada'); regex(/(?:\|\s?(work|publisher)\s?\=\s?\[?\[?nationalpost\.com\]?\]?)(?=[\s\.]*[\|\}])/gi, '|work=National Post |location=Canada'); regex(/(?:\|\s?(work|publisher)\s?\=\s?\[?\[?vancouversun\.com\]?\]?)(?=[\s\.]*[\|\}])/gi, '|work=The Vancouver Sun'); regex(/(?:\|\s?(work|publisher)\s?\=\s?\[?\[?thestar\.com\]?\]?)(?=[\s\.]*[\|\}])/gi, '|work=Toronto Star'); regex(/(?:\|\s?(work|publisher)\s?\=\s?\[?\[?torontosun\.com\]?\]?)(?=[\s\.]*[\|\}])/gi, '|work=Toronto Sun'); regex(/(?:\|\s?(work|publisher)\s?\=\s?\[?\[?time.com\]?\]?)(?=[\s\.]*[\|\}])/gi, '|work=Time'); regex(/(?:\|\s?(work|publisher)\s?\=\s?\[?\[?([\w\.]*Timesonline\.co(?:\.uk|m)|Times ?online)\]?\]?)(?=[\s\.]*[\|\}])/gi, '|work=The Times '); regex(/(?:\|\s?(work|publisher)\s?\=\s?\[?\[?[\w\.]*usatoday\.com\]?\]?)(?=[\s\.]*[\|\}])/gi, '|work=USA Today'); regex(/(?:\|\s?(work|publisher)\s?\=\s?\[?\[?washingtonpost\.com\]?\]?)(?=[\s\.]*[\|\}])/gi, '|work=The Washington Post'); regex(/(?:\|\s?(work|publisher)\s?\=\s?\[?\[?washingtontimes\.com\]?\]?)(?=[\s\.]*[\|\}])/gi, '|work=The Washington Times'); regex(/(?:\|\s?(work|publisher)\s?\=\s?\[?\[?[\w\.]*wsj\.com\]?\]?)(?=[\s\.]*[\|\}])/gi, '|work=The Wall Street Journal');

txt.value=txt.value.replace(/(?:\|\s?(work|publisher)\s?\=\s?\[?\[?[\w\.]*un\.org\]?\]?)(?=[\s\.]*[\|\}])/gi, '|publisher=United Nations');

//returns 'work=' for traditional media not requiring location dab txt.value=txt.value.replace(/(?:\|\s?(?:publisher|work)\s?\=\s?\[\[(the )?(Billboard|Billboard Magazine|boston globe|chicago tribune|china daily|people.s daily|Houston chronicle|denver post|der spiegel|The economist|Entertainment Weekly|forbes(?:\smagazine|)|Financial Times|FT|(?:The |)Globe and Mail|(?:The |)Vancouver Sun|Guardian|Hello!|International Herald Tribune|iht|(?:los angeles|la) times|le figaro|le monde|lib[ée]ration|mojo|newsday|newsweek|nydailynews|new york(?: daily news| Post| Times|er)|Q magazine|rolling\sstone|scmp|south china morning post|(?:San Francisco|sf) Chronicle|Sports Illustrated|Sydney Morning Herald|smh|Chicago Sun.Times|the australian|Ottawa Citizen|Ottawa Sun|toronto (?:star|sun)|time magazine|time|usa today|washington (?:post|times)|Wall Street Journal)\]\])(?=[\s\.]*[\|\}])/gi, '|work=$1$2'); txt.value=txt.value.replace(/(?:\|\s?(?:work|publisher)\s?\=\s?(?:\[\[)?((?:bloomberg |)business\s?week)(?:\]\])?)(?=[\s\.]*[\|\}])/gi, '|work=$1');

txt.value=txt.value.replace(/\|\s?(?:publisher)\s?\=\s?(the |)(boston globe|chicago tribune|china daily|people.s daily|Houston chronicle|denver post|Financial Times|FT|(?:The |)Globe and Mail|(?:The |)Vancouver Sun|(?:The |)Guardian|International Herald Tribune|iht|(?:los angeles|la) times|le figaro|le monde|lib[ée]ration|newsday|nydailynews|new york(?: daily news| Post| Times|er)|scmp|south china morning post|(?:San Francisco|sf) Chronicle|Sydney Morning Herald|smh|Chicago Sun.Times|the australian|Ottawa Citizen|Ottawa Sun|toronto (?:star|sun)|usa today|washington (?:post|times)|Wall Street Journal)(?=[\s\.]*[\|\}])/gi, '|work=$1$2'); txt.value=txt.value.replace(/\|\s?(?:publisher)\s?\=\s?(Billboard|der spiegel|The economist|Entertainment Weekly|forbes|Hello!|mojo|The Nation|newsweek|Q|rolling\sstone|Sports Illustrated)(?:\smagazine|)(?=[\s\.]*[\|\}])/gi, '|work=$1'); txt.value=txt.value.replace(/(?:\|\s?(?:newspaper|work|publisher)\s?\=\s?(?:\[\[)?(?:The |)(?:new yorker)(?: magazine|)(?:\]\])?)(?=[\s\.]*[\|\}])/gi, '|work=The New Yorker');

//returns 'publisher=' for new media news magazines txt.value=txt.value.replace(/(?:\|\s?(?:newspaper|work|publisher)\s?\=\s?(?:\[\[)?(Huffington Post)(?:\]\])?)(?=[\s\.]*[\|\}])/gi, '|work=$1'); txt.value=txt.value.replace(/(?:\|\s?(?:newspaper|work|publisher)\s?\=\s?(?:\[\[)?(Digitalspy.co.uk)(?:\]\])?)(?=[\s\.]*[\|\}])/gi, '|work=Digital Spy'); txt.value=txt.value.replace(/(?:\|\s?(?:newspaper|work|publisher)\s?\=\s?(?:\[\[)?([\w\.]*salon\.com)(?:\]\])?)(?=[\s\.]*[\|\}])/gi, '|work=Salon.com'); txt.value=txt.value.replace(/(?:\|\s?(?:newspaper|work|publisher)\s?\=\s?(?:\[\[)?([\w\.]*hollywoodreporter\.com|Hollywood Reporter)(?:\]\])?)(?=[\s\.]*[\|\}])/gi, '|work=The Hollywood Reporter'); //	txt.value=txt.value.replace(/(?:\|\s?(?:newspaper|work|publisher)\s?\=\s?(?:\[\[)?([\w\.]*Rottentomatoes\.com|Rotten Tomatoes)(?:\]\])?)(?=[\s\.]*[\|\}])/gi, '|publisher=Rotten Tomatoes'); //	txt.value=txt.value.replace(/(?:\|\s?(?:newspaper|work|publisher)\s?\=\s?(?:\[\[)?([\w\.]*Metacritic(?:\.com))(?:\]\])?)(?=[\s\.]*[\|\}])/gi, '|publisher=Metacritic');

//returns 'publisher=' for electronic media txt.value=txt.value.replace(/(?:\|\s?(?:newspaper|work|publisher)\s?\=\s?(?:\[\[)?(bbc.co.uk)(?:\]\])?)(?=[\s\.]*[\|\}])/gi, '|publisher=BBC'); //	txt.value=txt.value.replace(/(?:\|\s?(newspaper|work|publisher)\s?\=\s?\[?\[?[\w\.]*(bbc\.co\.uk)\]?\]?)(?=[\s\.]*[\|\}])/gi, '|publisher=BBC'); txt.value=txt.value.replace(/(?:\|\s?(newspaper|work|publisher)\s?\=\s?(?:\[\[)(bbc( sports?| news(?: online|)|))(?:\]\]))(?=[\s\.]*[\|\}])/gi, '|$1=$2'); txt.value=txt.value.replace(/(?:\|\s?(newspaper|work|publisher)\s?\=\s?(bbc( sports?| news(?: online|)|)))(?=[\s\.]*[\|\}])/gi, '|$1=$2'); txt.value=txt.value.replace(/(=[ ]?BBC News)( online|\.com)(?=[\s\.]*[\|\}])/gi, '$1'); txt.value=txt.value.replace(/(?:\|\s?(?:newspaper|publisher|work)\s?\=\[\[(Al\sjazeera( English)?|AMG|All\s?Music\s?Guide|Allmusic|Amazon\.com|(?:American|Australian|Canadian|British) Broadcasting Corporation|Bloomberg|Cable News Network|cnn|Fox News|Fox News Channel|Google|MSN|MTV|Myspace|mlb\.com|xinhua( news agency)?|Yahoo!?|You\s?Tube)\]\])(?=[\s\.]*[\|\}])/gi, '|publisher=$1'); txt.value=txt.value.replace(/(?:\|\s?(?:work|newspaper)\s?\=(Al\sjazeera( English)?|AMG|All\s?Music\s?Guide|Allmusic|Amazon\.com|(?:American|Australian|Canadian|British) Broadcasting Corporation|Bloomberg[ ]*\||Cable News Network|cnn|(?:ESPN|)cricinfo|Fox News|Fox News Channel|Google|MSN|MTV|Myspace|mlb|UEFA|VH1|xinhua( news agency)?|Yahoo!?|You\s?Tube))(?:\.com)(?=[\s\.]*[\|\}])/gi, '|publisher=$1'); txt.value=txt.value.replace(/(?:(?:at Discogs |)\|\s?(?:newspaper|work|publisher)\s?\=\s?\[?\[?[\w\.]*(Discogs)(?:\.com)\]?\]?)(?=[\s\.]*[\|\}])/gi, '|work=$1');

//Television media and networks txt.value=txt.value.replace(/(?:\|\s?(publisher|station)\s?\=\[\[(BBC (?:One|Two|Three|Four|Five|Six)|Channel [45])\]\])(?=[\s\.]*[\|\}])/gi, '|$1=$2 '); txt.value=txt.value.replace(/(?:\|\s?(publisher|station)\s?\=\[\[(?:Channel Five \(UK\)\||)(Channel Five|Channel 5)\]\])(?=[\s\.]*[\|\}])/gi, '|$1=Channel 5 '); txt.value=txt.value.replace(/(?:\|\s?(publisher|station)\s?\=\[\[(Network Ten)\]\])(?=[\s\.]*[\|\}])/gi, '|$1=$2 |location=Australia'); txt.value=txt.value.replace(/(?:\|\s?(publisher|station)\s?\=\[\[(?:Ten|Eleven) \(TV channel\)\|(Ten|Eleven)\]\])(?=[\s\.]*[\|\}])/gi, '|$1=$2 |location=Australia');

//returns 'publisher=' for electronic media stripped of domain suffices txt.value=txt.value.replace(/(?:\|\s?(author|newspaper|work|publisher)\s?\=\s?\[?\[?ap\.org\]?\]?)(?=[\s\.]*[\|\}])/gi, '|agency=Associated Press'); txt.value=txt.value.replace(/(?:\|\s?(author|newspaper|work|publisher)\s?\=\s?\[?\[?afp\.com\]?\]?)(?=[\s\.]*[\|\}])/gi, '|agency=Agence France-Presse'); txt.value=txt.value.replace(/(?:\|\s?(author|newspaper|work|publisher)\s?\=\s?\[?\[?reuters\.com\]?\]?)(?=[\s\.]*[\|\}])/gi, '|agency=Reuters'); txt.value=txt.value.replace(/(?:\|\s?(author|newspaper|work|publisher)\s?\=\s?\[?\[?kyodonews\.jp\]?\]?)(?=[\s\.]*[\|\}])/gi, '|agency=Kyodo News'); txt.value=txt.value.replace(/(?:\|\s?(author|newspaper|work|publisher)\s?\=\s?\[?\[?xinhuanet\.com\]?\]?)(?=[\s\.]*[\|\}])/gi, '|agency=Xinhua News Agency '); txt.value=txt.value.replace(/(?:\|\s?(newspaper|work|publisher)\s?\=\s?\[?\[?aljazeera\.(com|net)\]?\]?)(?=[\s\.]*[\|\}])/gi, '|publisher=Aljazeera'); txt.value=txt.value.replace(/(?:\|\s?(newspaper|work|publisher)\s?\=\s?\[?\[?bloomberg\.com\]?\]?)(?=[\s\.]*[\|\}])/gi, '|publisher=Bloomberg'); txt.value=txt.value.replace(/(?:\|\s?(newspaper|work|publisher)\s?\=\s?\[?\[?[\w\.]*cnn\.com\]?\]?)(?=[\s\.]*[\|\}])/gi, '|publisher=CNN'); txt.value=txt.value.replace(/(?:– ESPN )?(?:\|\s?(newspaper|work|publisher)\s?\=\s?\[?\[?[\w\.]*espn(\.go)?.com\]?\]?)(?=[\s\.]*[\|\}])/gi, '|publisher=ESPN'); txt.value=txt.value.replace(/(?:\|\s?(newspaper|work|publisher)\s?\=\s?\[?\[?foxnews\.com\]?\]?)(?=[\s\.]*[\|\}])/gi, '|publisher=Fox News'); txt.value=txt.value.replace(/(?:\|\s?(newspaper|work|publisher)\s?\=\s?\[?\[?huffingtonpost\.com\]?\]?)(?=[\s\.]*[\|\}])/gi, '|work=Huffington Post'); txt.value=txt.value.replace(/(?:\|\s?(newspaper|work|publisher)\s?\=\s?\[?\[?msnbc\.com\]?\]?)(?=[\s\.]*[\|\}])/gi, '|publisher=MSNBC'); txt.value=txt.value.replace(/(?:– Google Books )?(?:\|\s?(newspaper|work|publisher)\s?\=\s?\[?\[?books.google\.com?(?:\.\w{2,3}|)\]?\]?)(?=[\s\.]*[\|\}])/gi, '|publisher=Google Books'); txt.value=txt.value.replace(/(?:\|\s?(newspaper|work|publisher)\s?\=\s?\[?\[?[\w\.]*google\.com\]?\]?)(?=[\s\.]*[\|\}])/gi, '|publisher=Google');

txt.value=txt.value.replace(/(?:\|\s?(newspaper|work|publisher)\s?\=\s?\[?\[?(mtv|twitter|vh1|youtube)\.com\]?\]?)(?=[\s\.]*[\|\}])/gi, '|publisher=\'\'$2\'\''); regex(/(\|(?:newspaper|work|publisher)=)[ ]*[Yy]outube/g, '|publisher=YouTube');

txt.value=txt.value.replace(/(?:\|\s?(newspaper|work|publisher)\s?\=\s?\[?\[?((?:[\w]*\.|)Europa\.eu|Europa \(web portal\)\|Europa)\]?\]?)(?=[\s\.]*[\|\}])/gi, '|work=\'\'Europa (web portal)\'\'');

txt.value=txt.value.replace(/(?:\|\s?(?:newspaper|publisher|work)\s?\=\s?(?:\[\[)(AF?P\b|(?:the |)Associated Press|Agence France-Presse|Kyodo ?News|Reuters)(?:\]\]))(?=[\s\.]*[\|\}])/g, '|agency=$1'); txt.value=txt.value.replace(/\[\[(?:(?:Associated Press|Agence France-Presse)\||)(ABC|AP|AFP)\]\]/g, '$1'); txt.value=txt.value.replace(/\|\s?(?:newspaper|publisher|work)\s?\=\s?(AF?P\b|(?:the |)Associated Press|Agence France-Presse)(?=[\s\.]*[\|\}])/g, '|agency=$1');

//rem linking within locations field regex(/(\|[ ]*?location=[ ]*?)\[\[([^\|\]]+?)\]\](?:(,? )\[\[([^\|\]]+?)\]\]|)([ ]{0,1})/gi, '$1$2$3$4$5'); regex(/(\|[ ]*?location=[ ]*?)\[\[(?:[^\|\]]+?\|)([\w\s\,]+?)\]\](?:(,? )\[\[([^\|\]]+?)\]\]|)([ ]{0,1})/gi, '$1$2$3$4$5');

//rem underlinings within certain fields txt.value=txt.value.replace(/(\|\s?(?:journal|newspaper|periodical|publisher|work)\s?\=\s?) ([^\|\}]*)<\/u>(?=[\s\.]*[\|\}])/gi, '$1'); }

function Ohc_publishers { var txt=document.editform.wpTextbox1;

//linked publishing houses txt.value=txt.value.replace(/(?:\|\s?(newspaper|work|publisher)\s?\=\s?\[?\[?Hachette Filipacchi Médias\|(Hachette Filipacchi) \(UK\) Ltd\]?\]?)(?=[\s\.]*[\|\}])/gi, ''); txt.value=txt.value.replace(/(?:\|\s?(newspaper|work|publisher)\s?\=\s?\[?\[?(John Fairfax (and Sons Ltd\.?|Holdings)|Fairfax(?: Media( Limited)| Digital| newspapers))\]?\]?)(?=[\s\.]*[\|\}])/gi, ''); txt.value=txt.value.replace(/(?:\|\s?publisher\s?\=\s?(\[\[|)(Associated Newspapers|Condé Nast Publications|Fairfax Media|Gannett Company|(Guardian|Telegraph) Media Group|(?:Guardian|Independent) News (?:and|&) Media|Imdb Inc\.?|IDG|IPC Media|MTV Networks|(The |)(?:Washington Post|(?:New York|Seattle) Times) Company|News (?:Corporation|International|Limited)|Prometheus Global Media|Tribune Company|Trinity Mirror|Times Newspapers (?:Limited|Ltd.?)|Nielsen (?: Media Research|Business Media(, Inc\.?|))|Rovi Corporation|Viacom|Time (?:Warner ?|)Inc\.?)(\]\]|))(?=[\s\.]*[\|\}])/gi, '');

}

function Ohc_sources_cleanup { var txt=document.editform.wpTextbox1;

// relocating 'location' parameter outside citation templates regex(/(Daily News) \|location=(New York)()/gi, '$1$3, $2'); regex(/(The Gazette) \|location=(Montreal)()/gi, '$1$3, $2'); regex(/(Evening Standard) \|location=(London)()/gi, '$1$3, $2'); regex(/(La Presse) \|location=(Canada)()/gi, '$1$3, $2');

regex(/(ABC|Sport) \|location=(Spain)()/gi, '$1$3, $2'); regex(/(El Mundo) \|location=(Argentina|Bolivia|California|Colombia|Cuba|El Salvador|Puerto Rico|Spain|Venezuela)()/gi, '$1$3, $2');

regex(/(\[\[)(Daily News) \|location=(New York)(\]\])/gi, '$1$2 \($3\)|$2$4'); regex(/(\[\[)(The Gazette) \|location=(Montreal)(\]\])/gi, '$1$2 \($3\)|$2$4'); regex(/(\[\[)(The Province)( \|location=Vancouver, BC)(\]\])/gi, '$1$2$4$3 '); regex(/(\[\[)(Evening Standard)( \|location=London)(\]\])/gi, '$1$2$4$3 '); regex(/(\[\[)(La Presse) \|location=(Canada)(\]\])/gi, '$1$2 \(Canadian newspaper\)|$2$4');

regex(/(\[\[)(ABC|Sport) \|location=(Spain)(\]\])/gi, '$1$2 \(newspaper\)|$2$4'); regex(/(\[\[)(El Mundo) \|location=(Argentina|Bolivia|California|Colombia|Cuba|El Salvador|Puerto Rico|Spain|Venezuela)(\]\])/gi, '$1$2 \($3\)|$2$4');

regex(/(\[\[)(Nature|Science)(\]\])/g, '$1$2 \(journal\)|$2$3');

// removing ambiguous links created txt.value=txt.value.replace(/\[\[(Billboard)\]\]/g, '$1'); txt.value=txt.value.replace(/\[\[(Empire)\]\]/g, '$1'); txt.value=txt.value.replace(/\[\[(People)\]\]/g, '$1'); txt.value=txt.value.replace(/\[\[(Time)\]\]/g, '$1'); txt.value=txt.value.replace(/\[\[(Vanity Fair)\]\]/g, '$1'); txt.value=txt.value.replace(/\[\[(Vogue)\]\]/g, '$1'); txt.value=txt.value.replace(/\[\[(Wired)\]\]/g, '$1');

// removing redundancies regex(/\|[ ]?language[ ]?\=[ ]?English[ ]*?(?=[\|\}])/gi, ''); //note: adjusted for false positive in infoboxes books regex(/- [\w]*\.com[ ]*\|/gi, '|'); regex(/(.) – Google [^ \]]*(\][\.,;]) Books\.google\.\w{2,3}(\.| )/gi, '$1$2Google Books$3'); regex(/(.) at Discogs(\][\.,;]) Discogs\.com(\.| )/gi, '$1$2Discogs$3'); regex(/\|\s?author\s?\=(?:posted|publishe[dr]|written)\s?by\s/gi, '|author='); regex(/\|\s?(?:work|publisher)(\s?\=MTV)\|\s?publisher\s?\=\s?Viacom/gi, '|publisher$1=');

regex(/\|\s?(?:publisher|work)\s?\=\s?(?:BBC|BBC News(?: Online|))\s*(\|[^}<>]*|)\|\s?publisher\s?\=\s?(?:BBC|BBC News(?: Online|)|British Broadcasting Corporation)(?=[\s\.]*[\|\}])/g, '|publisher=BBC News $1'); regex(/\|\s?(?:publisher|work)\s?\=\s?(BBC Sports?)\s*(\|[^}<>]*|)\|\s?publisher\s?\=\s?(?:BBC|BBC News(?: Online|)|British Broadcasting Corporation)(?=[\s\.]*[\|\}])/g, '|publisher=$1$2'); regex(/-[ ]*Google Books[ ]*(\|[^}]*|)\|\s?publisher\s?\=\s?Google Books(?=[\s\.]*[\|\}])/g, '|publisher=Google Books $1'); regex(/\|\s?work\s?\=\s?([^\|\}<>]*)(\s?\|[^}<>]*|)\|\s?(?:publisher|work)\s?\=\s?\1(?=[\s\.]*[\|\}])/g, '|work=$1$2'); regex(/\|\s?publisher\s?\=\s?([^\|\}<>]*)(\s?\|[^}]*|)\|\s?(?:publisher|work)\s?\=\s?\1(?=[\s\.]*[\|\}])/g, '|publisher=$1$2'); regex(/(\|publisher=)(Turner Sports Interactive, Inc)\.? ?\|publisher=(NBA) ?\|/gi, '$1$3./$2 |'); regex(/(\|publisher=)(NBA) ?\|publisher=(Turner Sports Interactive, Inc)\.? ?\|/gi, '$1$3./$2 |'); regex(/\|\s?location\s?\=\s?New York(?: City|)\s*(\|[^}<>]*|)\|\s?location\s?\=\s?(New York(?: City|)|USA)(?=[\s\.]*[\|\}])/g, '|location=New York $1');

regex(/(?:\|[ ]*?location=[^\[\]\|]*)(\|[ ]*?location=[^\[\]\|\}]*)(?=[\|\}])+/gi, '$1'); regex(/(\|[ ]*?publisher=[^\[\]\|]*)(?:\|[ ]*?publisher=[^\[\]\|\}]*)(?=[\|\}])+/gi, '$1'); regex(/(\|[ ]*?work=[^\[\]\|]*)(?:\|[ ]*?work=[^\[\]\|\}]*)(?=[\|\}])+/gi, '$1');

regex(/(\|[ ]*?author=)(?:(?:Mon|Tues|Wednes|Thurs|Fri|Satur|Sun)day,? ?)(?=[^\]\|\}]*\|)/gi, '$1');

regex(/( &#124; [\w, ]*?)(?=[ ]&#124)/gi, ''); //        regex(/( \| [^=\|\{\}\]]*?)(?=[ ]\|)/gi, ''); //disabled 3 October 2012 - false positive removal of elements in wikitable regex(/( &#124; News)(?=[ ]?[&\|])/gi, ''); regex(/( &#124; (?:Football|Latest)(?: News|))(?=[ ]?[&\|])/gi, ''); regex(/\|\s?title\s?\=\s?BBC (?:News|Sport)\s?(?:–|&#124; )\s?/gi, '|title=');

regex(/(DOC|PDF)\) \./gi, '$1).');

//        setreason('per WP:CLEANUP', 'append'); }

/** **/ /// PROTECTION BY STRING SUBSTITUTION var linkmap=[]; function ohc_protect_linkspam {   // protects everything within reference tags // the sensitive part is stored and replaced with a unique identifier, // which is later replaced with the stored part. var protect_function = function(s, begin, replace, end) { linkmap.push(replace); return begin + "⍌"+(linkmap.length-1)+"⍍" + end; }   regex(/(]*?>)(.*?)(<\/ref>)/gi, protect_function); regex(/(\*[ ]?\[(?:https?:|ftp:))([^\]]*)(\])/gi, protect_function); } function ohc_unprotect_linkspam {   //removes protection put in place by function ohc_protect_fmt (all cats, templates etc.) regex(/⍌([0-9]+)⍍/g, function(x, n) {       var res = linkmap[n];        res = res.replace(/⍌([0-9]+)⍍/g, function(x, n) { var res = linkmap[n]; res = res.replace(/⍌([0-9]+)⍍/g, function(x, n) {               var res = linkmap[n];                res = res.replace(/⍌([0-9]+)⍍/g, function(x, n) { return linkmap[n]; });               return res;            }); return res; });       return res;    }); }

/** **/ function ohc_protect_urls {   // protects only urls // the sensitive part is stored and replaced with a unique identifier, // which is later replaced with the stored part. var protect_function = function(s, begin, replace, end) { linkmap.push(replace); return begin + "⍌"+(linkmap.length-1)+"⍍" + end; }   regex(/(https?:|ftp:)([^\s\]]*)([\s\]])/gi, protect_function); } function ohc_unprotect_urls {   //removes protection put in place by function ohc_protect_fmt (all cats, templates etc.) regex(/⍌([0-9]+)⍍/g, function(x, n) {       var res = linkmap[n];        res = res.replace(/⍌([0-9]+)⍍/g, function(x, n) { var res = linkmap[n]; res = res.replace(/⍌([0-9]+)⍍/g, function(x, n) {               var res = linkmap[n];                res = res.replace(/⍌([0-9]+)⍍/g, function(x, n) { return linkmap[n]; });               return res;            }); return res; });       return res;    }); } /** **/ function Ohc_Source_edit_summary{ //Add a tag to the summary box setoptions(minor='true'); setreason('per WP:MOSTEXT', 'append'); doaction('diff'); } function Ohc_linkspam_driver { var txt=document.editform.wpTextbox1; ohc_protect_linkspam; Ohc_linkspam; ohc_unprotect_linkspam; setreason('rem linkspam', 'append'); } function Ohc_ref_format { var txt=document.editform.wpTextbox1; ohc_protect_urls; Ohc_sources_prep; Ohc_dab_news_sources; Ohc_news_sources; Ohc_sources_cleanup; ohc_unprotect_urls; } function Ohc_ref_format_driver { var txt=document.editform.wpTextbox1; Ohc_ref_format; Ohc_Source_edit_summary; } addOnloadHook(function { if(document.forms.editform) { //  mw.util.addPortletLink('p-tb', 'javascript:function_name', 'Button name', 't-dmy', 'Hover text', , );  mw.util.addPortletLink('p-tb', 'javascript:Ohc_linkspam_driver', 'Linkspam', 'rm-linkspam', 'removes linkspam in running text', , );  mw.util.addPortletLink('p-tb', 'javascript:Ohc_ref_format_driver', 'Fix news sources', 't-citefix', 'format citations', , );  mw.util.addPortletLink('p-tb', 'javascript:Ohc_publishers', 'Rem publishers', 't-citefix', 'Removing certain publishers fields', , );  mw.util.addPortletLink('p-tb', 'javascript:Ohc_ref_format_new', 'New source module', 't-citefix', 'Remove source wikilink', , );  } });