User:Ohconfucius/test/Football links.js

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

//	txt.value=txt.value.replace(/\[\[(foobar)(s|)\]\]/gi, '$1$2');

//Redirecting pipes txt.value=txt.value.replace(/\[\[striker(s|)\]\]/gi, 'striker$1'); txt.value=txt.value.replace(/\[\[(midfielder) \(?:(?:Association |)[Ff]ootball\)\|(midfielder)\]\]/gi, '$1'); txt.value=txt.value.replace(/\[\[(midfielder) \(?:(?:Association |)[Ff]ootball\)\|([^\]]*)\]\]/gi, '$2'); txt.value=txt.value.replace(/\[(football \(soccer\)|soccer)\|/gi, '[association football|'); txt.value=txt.value.replace(/\[(Forward|Defender|Goalkeeper) \(Association [Ff]ootball\)\|/g, '[$1 (association football)|'); txt.value=txt.value.replace(/\[(Forward|Striker|Forward \(soccer\)|Hole \(soccer\)|The hole \(soccer\)|Striker \(football\)|Forward \(football\)|Striker \(association football\))\|/gi, '[Forward (association football)|'); txt.value=txt.value.replace(/\[(Wingback|Defender|Football defender|Back|Sweeper|Defence|Right Defender|Defender|Full-back)\((football|soccer)\)\]\]/gi, '[Defender (association football)|'); txt.value=txt.value.replace(/\[(Goalkeeper|Football goalkeeper|Goalkeeper \(soccer\)|Keeper \(soccer\)|Soccer goalie|Goalkeeper \(football\))\|/gi, '[Goalkeeper (association football)|');

//1. French former football \[\[(POSITION \(association football\)\|POSITION)\]\] txt.value=txt.value.replace(/\[\[France\|French\]\] ((?:retired |former |)(?:professional |)|)\[\[(?:association football\||)(?:Football \(soccer\)|(?:association |)football|soccer)\]\] (\[\[([ \w-]* \((?:association |)football\)\|[ \w-]*)\]\])/gi, '$1French footballer who played $2'); //1a. French former football midfielder txt.value=txt.value.replace(/\[\[France\|French\]\] ((?:retired |former |)(?:professional |)|)\[\[(?:association football\||)(?:Football \(soccer\)|(?:association |)football|soccer)\]\] (\[\[midfielder\]\])/gi, '$1French footballer who played $2'); //2. French (unlinked) former football POSITION) txt.value=txt.value.replace(/French ((?:retired |former |)(?:professional |)|)\[\[(?:association football\||)(?:Football \(soccer\)|(?:association |)football|soccer)\]\] (\[\[([\w- ]* \((?:association |)football\)\|[\w- ]*)\]\])/gi, '$1French footballer who played $2'); //2a. French (unlinked) former football midfielder txt.value=txt.value.replace(/French ((?:retired |former |)(?:professional |)|)\[\[(?:association football\||)(?:Football \(soccer\)|(?:association |)football|soccer)\]\] (\[\[midfielder\]\])/gi, '$1French footballer who played $2'); //3. French international football \[\[(POSITION \(association football\)\|POSITION)\]\] txt.value=txt.value.replace(/\[\[France\|French\]\] international \[\[(?:association football\||)(?:Football \(soccer\)|(?:association |)football|soccer)\]\] (\[\[([\w- ]* \((?:association |)football\)\|[\w- ]*)\]\])/gi, 'French international footballer who played $1'); //4. French (unlinked) international football \[\[(POSITION \(association football\)\|POSITION)\]\] txt.value=txt.value.replace(/French international \[\[(?:association football\||)(?:Football \(soccer\)|(?:association |)football|soccer)\]\] (\[\[([\w- ]* \((?:association |)football\)\|[\w- ]*)\]\])/gi, 'French international footballer who played $1');

//5. French former football player txt.value=txt.value.replace(/\[\[France\|French\]\] ((?:retired |former |)(?:professional |)|)\[\[(?:association football\||)(?:association football|soccer|football|Football \(soccer\))\]\] player/gi, '$1French footballer'); //6. French (unlinked) former football player txt.value=txt.value.replace(/French ((?:retired |former |)(?:professional |)|)\[\[(?:association football\||)(?:association football|soccer|football|Football \(soccer\))\]\] player/gi, '$1French footballer'); //7. French international football player txt.value=txt.value.replace(/\[\[France\|French\]\] international \[\[(?:association football\||)(?:association football|soccer|football|Football \(soccer\))\]\] player/gi, 'French international footballer'); //8. French (unlinked) international football player txt.value=txt.value.replace(/French international \[\[(?:association football\||)(?:association football|soccer|football|Football \(soccer\))\]\] player/gi, 'French international footballer');

//9. French former footballer txt.value=txt.value.replace(/\[\[France\|French\]\] ((?:retired |former |)(?:professional |)|)\[\[(?:association football\||)(?:association |)football(er|)\]\]/gi, '$1French football$2'); //10. French (unlinked) former footballer txt.value=txt.value.replace(/French ((?:retired |former |)(?:professional |)|)\[\[(?:association football\||)(?:association |)football(er|)\]\]/gi, '$1French football$2'); //11. French international footballer txt.value=txt.value.replace(/\[\[France\|French\]\] international \[\[(?:association football\||)(?:association |)football(er|)\]\]/gi, 'French international football$1'); //12. French (unlinked) international footballer txt.value=txt.value.replace(/French international \[\[(?:association football\||)(?:association |)football(er|)\]\]/gi, 'French international football$1');

//	txt.value=txt.value.replace(/\[\[(foobar)(s|)\]\]/gi, '$1$2'); //1. former football \[\[(POSITION \(association football\)\|POSITION)\]\] from France txt.value=txt.value.replace(/((?:retired |former |)(?:professional |)|)\[\[(?:association football\||)(?:Football \(soccer\)|(?:association |)football|soccer)\]\] (\[\[([\w- ]* \((?:association |)football\)\|[\w- ]*)\]\] from \[\[France\]\])/gi, '$1French footballer who played $2'); //2. former football \[\[(POSITION \(association football\)\|POSITION)\]\] from France (unlinked) txt.value=txt.value.replace(/((?:retired |former |)(?:professional |)|)\[\[(?:association football\||)(?:Football \(soccer\)|(?:association |)football|soccer)\]\] (\[\[([\w- ]* \((?:association |)football\)\|[\w- ]*)\]\]) from France/gi, '$1French footballer who played $2'); //3. n international football \[\[(POSITION \(association football\)\|POSITION)\]\] from France txt.value=txt.value.replace(/an international \[\[(?:association football\||)(?:Football \(soccer\)|(?:association |)football|soccer)\]\] (\[\[([\w- ]* \((?:association |)football\)\|[\w- ]*)\]\]) from \[\[France\]\]/gi, 'a French international footballer who played $1'); //4. international football \[\[(POSITION \(association football\)\|POSITION)\]\] from France (unlinked) txt.value=txt.value.replace(/an international \[\[(?:association football\||)(?:Football \(soccer\)|(?:association |)football|soccer)\]\] (\[\[([\w- ]* \((?:association |)football\)\|[\w- ]*)\]\]) from France/gi, 'a French international footballer who played $1');

//5. former football player from France txt.value=txt.value.replace(/((?:retired |former |)(?:professional |)|)\[\[(?:association football\||)(?:association football|soccer|football|Football \(soccer\))\]\] player from \[\[France\]\]/gi, '$1French footballer'); //6. former football player from France (unlinked) txt.value=txt.value.replace(/((?:retired |former |)(?:professional |)|)\[\[(?:association football\||)(?:association football|soccer|football|Football \(soccer\))\]\] player from France/gi, '$1French footballer'); //7. international football player from France txt.value=txt.value.replace(/an international \[\[(?:association football\||)(?:association football|soccer|football|Football \(soccer\))\]\] player from \[\[France\]\]/gi, 'a French international footballer'); //8. international football player from France (unlinked) txt.value=txt.value.replace(/an international \[\[(?:association football\||)(?:association football|soccer|football|Football \(soccer\))\]\] player from France/gi, 'a French international footballer');

//9. former footballer from France txt.value=txt.value.replace(/((?:retired |former |)(?:professional |)|)\[\[(?:association football\||)(?:association |)football(er|)\]\] from \[\[France\]\]/gi, '$1French football$2'); //10. former footballer from France (unlinked) txt.value=txt.value.replace(/((?:retired |former |)(?:professional |)|)\[\[(?:association football\||)(?:association |)football(er|)\]\] from France/gi, '$1French football$2'); //11. international footballer from France txt.value=txt.value.replace(/an international \[\[(?:association football\||)(?:association |)football(er|)\]\] from \[\[France\]\]/gi, 'a French international football$1'); //12. international footballer from France (unlinked) txt.value=txt.value.replace(/an international \[\[(?:association football\||)(?:association |)football(er|)\]\] from France/gi, 'a French international football$1');

//1. Brazilian former football \[\[(POSITION \(association football\)\|POSITION)\]\] txt.value=txt.value.replace(/\[\[Brazil\]\]ian ((?:retired |former |)(?:professional |)|)\[\[(?:association football\||)(?:Football \(soccer\)|(?:association |)football|soccer)\]\] (\[\[([ \w-]* \((?:association |)football\)\|[ \w-]*)\]\])/gi, '$1association footballer who played $2'); //1a. Brazilian former football midfielder txt.value=txt.value.replace(/\[\[Brazil\]\]ian ((?:retired |former |)(?:professional |)|)\[\[(?:association football\||)(?:Football \(soccer\)|(?:association |)football|soccer)\]\] (\[\[midfielder\]\])/gi, '$1association footballer who played $2'); //2. Brazilian (unlinked) former football POSITION) txt.value=txt.value.replace(/Brazilian ((?:retired |former |)(?:professional |)|)\[\[(?:association football\||)(?:Football \(soccer\)|(?:association |)football|soccer)\]\] (\[\[([\w- ]* \((?:association |)football\)\|[\w- ]*)\]\])/gi, '$1association footballer who played $2'); //2a. Brazilian (unlinked) former football midfielder txt.value=txt.value.replace(/Brazilian ((?:retired |former |)(?:professional |)|)\[\[(?:association football\||)(?:Football \(soccer\)|(?:association |)football|soccer)\]\] (\[\[midfielder\]\])/gi, '$1association footballer who played $2'); //3. Brazilian international football \[\[(POSITION \(association football\)\|POSITION)\]\] txt.value=txt.value.replace(/\[\[Brazil\]\]ian international \[\[(?:association football\||)(?:Football \(soccer\)|(?:association |)football|soccer)\]\] (\[\[([\w- ]* \((?:association |)football\)\|[\w- ]*)\]\])/gi, 'Brazilian international footballer who played $1'); //4. Brazilian (unlinked) international football \[\[(POSITION \(association football\)\|POSITION)\]\] txt.value=txt.value.replace(/Brazilian international \[\[(?:association football\||)(?:Football \(soccer\)|(?:association |)football|soccer)\]\] (\[\[([\w- ]* \((?:association |)football\)\|[\w- ]*)\]\])/gi, 'Brazilian international footballer who played $1');

//5. Brazilian former association football player txt.value=txt.value.replace(/\[\[Brazil\]\]ian ((?:retired |former |)(?:professional |)|)\[\[(?:association football\||)(?:association football|soccer|football|Football \(soccer\))\]\] player/gi, '$1association footballer'); //6. Brazilian (unlinked) former association football player txt.value=txt.value.replace(/Brazilian ((?:retired |former |)(?:professional |)|)\[\[(?:association football\||)(?:association football|soccer|football|Football \(soccer\))\]\] player/gi, '$1association footballer'); //7. Brazilian international association football player txt.value=txt.value.replace(/\[\[Brazil\]\]ian international \[\[(?:association football\||)(?:association football|soccer|football|Football \(soccer\))\]\] player/gi, 'Brazilian international footballer'); //8. Brazilian (unlinked) international association football player txt.value=txt.value.replace(/Brazilian international \[\[(?:association football\||)(?:association football|soccer|football|Football \(soccer\))\]\] player/gi, 'Brazilian international footballer');

//9. Brazilian former footballer txt.value=txt.value.replace(/\[\[Brazil\]\]ian ((?:retired |former |)(?:professional |)|)\[\[(?:association football\||)(?:association |)football(er|)\]\]/gi, '$1association football$2'); //10. Brazilian (unlinked) former footballer txt.value=txt.value.replace(/Brazilian ((?:retired |former |)(?:professional |)|)\[\[(?:association football\||)(?:association |)football(er|)\]\]/gi, '$1association football$2]]'); //11. Brazilian international footballer txt.value=txt.value.replace(/\[\[Brazil\]\]ian international \[\[(?:association football\||)(?:association |)football(er|)\]\]/gi, 'Brazilian international football$1'); //12. Brazilian (unlinked) international footballer txt.value=txt.value.replace(/Brazilian international \[\[(?:association football\||)(?:association |)football(er|)\]\]/gi, 'Brazilian international football$1');

txt.value=txt.value.replace(/ a \[\[(?:Football in Brazil\|Brazilian football(er|))\]\]/gi, ' an association football$1');

//	txt.value=txt.value.replace(/\[\[(foobar)(s|)\]\]/gi, '$1$2'); //1. former football \[\[(POSITION \(association football\)\|POSITION)\]\] from Brazil txt.value=txt.value.replace(/((?:retired |former |)(?:professional |)|)\[\[(?:association football\||)(?:Football \(soccer\)|(?:association |)football|soccer)\]\] (\[\[([\w- ]* \((?:association |)football\)\|[\w- ]*)\]\] from \[\[Brazil\]\])/gi, '$1association footballer who played $2'); //2. former football \[\[(POSITION \(association football\)\|POSITION)\]\] from Brazil (unlinked) txt.value=txt.value.replace(/((?:retired |former |)(?:professional |)|)\[\[(?:association football\||)(?:Football \(soccer\)|(?:association |)football|soccer)\]\] (\[\[([\w- ]* \((?:association |)football\)\|[\w- ]*)\]\]) from Brazil/gi, '$1association footballer who played $2'); //3. n international football \[\[(POSITION \(association football\)\|POSITION)\]\] from Brazil txt.value=txt.value.replace(/an international \[\[(?:association football\||)(?:Football \(soccer\)|(?:association |)football|soccer)\]\] (\[\[([\w- ]* \((?:association |)football\)\|[\w- ]*)\]\]) from \[\[Brazil\]\]/gi, 'a Brazilian international footballer who played $1'); //4. international football \[\[(POSITION \(association football\)\|POSITION)\]\] from Brazil (unlinked) txt.value=txt.value.replace(/an international \[\[(?:association football\||)(?:Football \(soccer\)|(?:association |)football|soccer)\]\] (\[\[([\w- ]* \((?:association |)football\)\|[\w- ]*)\]\]) from Brazil/gi, 'a Brazilian international footballer who played $1');

//5. former football player from Brazil txt.value=txt.value.replace(/((?:retired |former |)(?:professional |)|)\[\[(?:association football\||)(?:association football|soccer|football|Football \(soccer\))\]\] player from \[\[Brazil\]\]/gi, '$1association footballer'); ///6. former football player from Brazil (unlinked) txt.value=txt.value.replace(/((?:retired |former |)(?:professional |)|)\[\[(?:association football\||)(?:association football|soccer|football|Football \(soccer\))\]\] player from Brazil/gi, '$1association footballer'); //7. international football player from Brazil txt.value=txt.value.replace(/an international \[\[(?:association football\||)(?:association football|soccer|football|Football \(soccer\))\]\] player from \[\[Brazil\]\]/gi, 'a Brazilian international footballer'); //8. international football player from Brazil (unlinked) txt.value=txt.value.replace(/an international \[\[(?:association football\||)(?:association football|soccer|football|Football \(soccer\))\]\] player from Brazil/gi, 'a Brazilian international footballer');

//9. former footballer from Brazil txt.value=txt.value.replace(/((?:retired |former |)(?:professional |)|)\[\[(?:association football\||)(?:association |)football(er|)\]\] from \[\[Brazil\]\]/gi, '$1association football$2'); //10. former footballer from Brazil (unlinked) txt.value=txt.value.replace(/((?:retired |former |)(?:professional |)|)\[\[(?:association football\||)(?:association |)football(er|)\]\] from Brazil/gi, '$1association football$2'); //11. international footballer from Brazil txt.value=txt.value.replace(/an international \[\[(?:association football\||)(?:association |)football(er|)\]\] from \[\[Brazil\]\]/gi, 'a Brazilian international football$1'); //12. international footballer from Brazil (unlinked) txt.value=txt.value.replace(/an international \[\[(?:association football\||)(?:association |)football(er|)\]\] from Brazil/gi, 'a Brazilian international football$1');

//1. Russian former football \[\[(POSITION \(association football\)\|POSITION)\]\] txt.value=txt.value.replace(/\[\[Russia\]\]n ((?:retired |former |)(?:professional |)|)\[\[(?:association football\||)(?:Football \(soccer\)|(?:association |)football|soccer)\]\] (\[\[([ \w-]* \((?:association |)football\)\|[ \w-]*)\]\])/gi, '$1association footballer who played $2'); //1a. Russian former football midfielder txt.value=txt.value.replace(/\[\[Russia\]\]n ((?:retired |former |)(?:professional |)|)\[\[(?:association football\||)(?:Football \(soccer\)|(?:association |)football|soccer)\]\] (\[\[midfielder\]\])/gi, '$1association footballer who played $2'); //2. Russian (unlinked) former football POSITION) txt.value=txt.value.replace(/Russian ((?:retired |former |)(?:professional |)|)\[\[(?:association football\||)(?:Football \(soccer\)|(?:association |)football|soccer)\]\] (\[\[([\w- ]* \((?:association |)football\)\|[\w- ]*)\]\])/gi, '$1association footballer who played $2'); //2a. Russian (unlinked) former football midfielder txt.value=txt.value.replace(/Russian ((?:retired |former |)(?:professional |)|)\[\[(?:association football\||)(?:Football \(soccer\)|(?:association |)football|soccer)\]\] (\[\[midfielder\]\])/gi, '$1association footballer who played $2'); //3. Russian international football \[\[(POSITION \(association football\)\|POSITION)\]\] txt.value=txt.value.replace(/\[\[Russia\]\]n international \[\[(?:association football\||)(?:Football \(soccer\)|(?:association |)football|soccer)\]\] (\[\[([\w- ]* \((?:association |)football\)\|[\w- ]*)\]\])/gi, 'Russian international footballer who played $1'); //4. Russian (unlinked) international football \[\[(POSITION \(association football\)\|POSITION)\]\] txt.value=txt.value.replace(/Russian international \[\[(?:association football\||)(?:Football \(soccer\)|(?:association |)football|soccer)\]\] (\[\[([\w- ]* \((?:association |)football\)\|[\w- ]*)\]\])/gi, 'Russian international footballer who played $1');

//5. Russian former association football player txt.value=txt.value.replace(/\[\[Russia\]\]n ((?:retired |former |)(?:professional |)|)\[\[(?:association football\||)(?:association football|soccer|football|Football \(soccer\))\]\] player/gi, '$1association footballer'); //6. Russian (unlinked) former association football player txt.value=txt.value.replace(/Russian ((?:retired |former |)(?:professional |)|)\[\[(?:association football\||)(?:association football|soccer|football|Football \(soccer\))\]\] player/gi, '$1association footballer'); //7. Russian international association football player txt.value=txt.value.replace(/\[\[Russia\]\]n international \[\[(?:association football\||)(?:association football|soccer|football|Football \(soccer\))\]\] player/gi, 'Russian international footballer'); //8. Russian (unlinked) international association football player txt.value=txt.value.replace(/Russian international \[\[(?:association football\||)(?:association football|soccer|football|Football \(soccer\))\]\] player/gi, 'Russian international footballer');

//9. Russian former footballer txt.value=txt.value.replace(/\[\[Russia\]\]n ((?:retired |former |)(?:professional |)|)\[\[(?:association football\||)(?:association |)football(er|)\]\]/gi, '$1association football$2'); //10. Russian (unlinked) former footballer txt.value=txt.value.replace(/Russian ((?:retired |former |)(?:professional |)|)\[\[(?:association football\||)(?:association |)football(er|)\]\]/gi, '$1association football$2]]'); //11. Russian international footballer txt.value=txt.value.replace(/\[\[Russia\]\]n international \[\[(?:association football\||)(?:association |)football(er|)\]\]/gi, 'Russian international football$1'); //12. Russian (unlinked) international footballer txt.value=txt.value.replace(/Russian international \[\[(?:association football\||)(?:association |)football(er|)\]\]/gi, 'Russian international football$1');

txt.value=txt.value.replace(/ a \[\[(?:Football in Russia\|Russian football(er|))\]\]/gi, ' an association football$1');

//	txt.value=txt.value.replace(/\[\[(foobar)(s|)\]\]/gi, '$1$2'); //1. former football \[\[(POSITION \(association football\)\|POSITION)\]\] from Russia txt.value=txt.value.replace(/((?:retired |former |)(?:professional |)|)\[\[(?:association football\||)(?:Football \(soccer\)|(?:association |)football|soccer)\]\] (\[\[([\w- ]* \((?:association |)football\)\|[\w- ]*)\]\] from \[\[Russia\]\])/gi, '$1association footballer who played $2'); //2. former football \[\[(POSITION \(association football\)\|POSITION)\]\] from Russia (unlinked) txt.value=txt.value.replace(/((?:retired |former |)(?:professional |)|)\[\[(?:association football\||)(?:Football \(soccer\)|(?:association |)football|soccer)\]\] (\[\[([\w- ]* \((?:association |)football\)\|[\w- ]*)\]\]) from Russia/gi, '$1association footballer who played $2'); //3. n international football \[\[(POSITION \(association football\)\|POSITION)\]\] from Russia txt.value=txt.value.replace(/an international \[\[(?:association football\||)(?:Football \(soccer\)|(?:association |)football|soccer)\]\] (\[\[([\w- ]* \((?:association |)football\)\|[\w- ]*)\]\]) from \[\[Russia\]\]/gi, 'a Russian international footballer who played $1'); //4. international football \[\[(POSITION \(association football\)\|POSITION)\]\] from Russia (unlinked) txt.value=txt.value.replace(/an international \[\[(?:association football\||)(?:Football \(soccer\)|(?:association |)football|soccer)\]\] (\[\[([\w- ]* \((?:association |)football\)\|[\w- ]*)\]\]) from Russia/gi, 'a Russian international footballer who played $1');

//5. former football player from Russia txt.value=txt.value.replace(/((?:retired |former |)(?:professional |)|)\[\[(?:association football\||)(?:association football|soccer|football|Football \(soccer\))\]\] player from \[\[Russia\]\]/gi, '$1association footballer'); ///6. former football player from Russia (unlinked) txt.value=txt.value.replace(/((?:retired |former |)(?:professional |)|)\[\[(?:association football\||)(?:association football|soccer|football|Football \(soccer\))\]\] player from Russia/gi, '$1association footballer'); //7. international football player from Russia txt.value=txt.value.replace(/an international \[\[(?:association football\||)(?:association football|soccer|football|Football \(soccer\))\]\] player from \[\[Russia\]\]/gi, 'a Russian international footballer'); //8. international football player from Russia (unlinked) txt.value=txt.value.replace(/an international \[\[(?:association football\||)(?:association football|soccer|football|Football \(soccer\))\]\] player from Russia/gi, 'a Russian international footballer');

//9. former footballer from Russia txt.value=txt.value.replace(/((?:retired |former |)(?:professional |)|)\[\[(?:association football\||)(?:association |)football(er|)\]\] from \[\[Russia\]\]/gi, '$1association football$2'); //10. former footballer from Russia (unlinked) txt.value=txt.value.replace(/((?:retired |former |)(?:professional |)|)\[\[(?:association football\||)(?:association |)football(er|)\]\] from Russia/gi, '$1association football$2'); //11. international footballer from Russia txt.value=txt.value.replace(/an international \[\[(?:association football\||)(?:association |)football(er|)\]\] from \[\[Russia\]\]/gi, 'a Russian international football$1'); //12. international footballer from Russia (unlinked) txt.value=txt.value.replace(/an international \[\[(?:association football\||)(?:association |)football(er|)\]\] from Russia/gi, 'a Russian international football$1'); //13a. a Russian football -> an association football txt.value=txt.value.replace(/ a \[\[(?:Russia)\]\]n football(er|)/gi, ' an association football$1'); //13b. a retired/professional Russian football -> a retired/professional association football txt.value=txt.value.replace(/ a \[\[(?:Russia)\]\]n ((?:retired |former |)(?:professional |)|)football(er|)/gi, ' a $1association football$2');

//Generic - Ejected from CT	txt.value=txt.value.replace(/\[\[List of (?:football clubs in Germany|German football clubs)(\|German football (?:club|team))\]\]/gi, 'German association football club'); //national football club -> national association football club txt.value=txt.value.replace(/\[\[(Argentina|Australia|Austria|Belgium|Brazil|British\sIsles|Canada|the Netherlands|Korea|People's\sRepublic\sof\sChina|the Philippines|Czech\sRepublic|Denmark|Finland|England|France|Germany|Spain|Greece|Hungary|India|Ireland|Italy|Mexico|Holland|New\sZealand|Norway|Poland|Portugal|Russia|Scotland|South\sAfrica|South\sKorea|Sweden|Switzerland|Wales)\|(Argentinian|Australian|Austrian|Belgian|Belgium|Brazilian|British|Canadian|Dutch|Korean|Chinese|(?:Ph|F)ilipp?in[eo]|Czech|Danish|Finnish|English|French|German|Spanish|Greek|Hungarian|Indian|Irish|Italian|Mexican|Middle\sEastern|(:the\s|)Netherlands|Holland|New\sZealand|Norwegian|Polish|Portuguese|Russian|Scandinavian|Scottish|South\sAfrican|South\sKorean|Swedish|Swiss|Welsh)\]\] \[\[football club\]\]/gi, '$2 association football club'); //national footballx -> national association football txt.value=txt.value.replace(/\[\[(Argentina|Australia|Austria|Belgium|Brazil|British\sIsles|Canada|the Netherlands|Korea|People's\sRepublic\sof\sChina|the Philippines|Czech\sRepublic|Denmark|Finland|England|France|Germany|Spain|Greece|Hungary|India|Ireland|Italy|Mexico|Holland|New\sZealand|Norway|Poland|Portugal|Russia|Scotland|South\sAfrica|South\sKorea|Sweden|Switzerland|Wales)\|(Argentinian|Australian|Austrian|Belgian|Belgium|Brazilian|British|Canadian|Dutch|Korean|Chinese|(?:Ph|F)ilipp?in[eo]|Czech|Danish|Finnish|English|French|German|Spanish|Greek|Hungarian|Indian|Irish|Italian|Mexican|Middle\sEastern|(:the\s|)Netherlands|Holland|New\sZealand|Norwegian|Polish|Portuguese|Russian|Scandinavian|Scottish|South\sAfrican|South\sKorean|Swedish|Swiss|Welsh)\]\] \[\[(?:(?:association football|[Ff]ootball \(soccer\))\|football|soccer)\]\]/gi, '$2 association football'); //National professional footballx club -> national association football club //National professional footballx club -> national association football club txt.value=txt.value.replace(/(?:\[\[|)(Australia|Austria|Brazil|Korea|India|New\sZealand|Russia|South\sAfrica|South\sKorea)(?:\]\]|)(n|ian|) (amateur |professional |)\[\[(?:[Ff]ootball \(soccer\)|soccer|[Aa]ssociation football)(?:\|football|)\]\] (club|\[\[(?:List of football clubs in (?:Australia|Austria|Brazil|Korea|India|New\sZealand|Russia|South\sAfrica|South\sKorea)|:Category:(Australia|Austria|Brazil|Korea|India|New\sZealand|Russia|South\sAfrica|South\sKorea)(n|ian|) football clubs)\|(?:club|team)\]\])/gi, '$3$1$2 association football club');

txt.value=txt.value.replace(/\[\[(Argentina|Australia|Austria|Belgium|Brazil|British\sIsles|Canada|the Netherlands|Korea|People's\sRepublic\sof\sChina|the Philippines|Czech\sRepublic|Denmark|Finland|England|France|Germany|Spain|Greece|Hungary|India|Ireland|Italy|Mexico|Holland|New\sZealand|Norway|Poland|Portugal|Russia|Scotland|South\sAfrica|South\sKorea|Sweden|Switzerland|Wales)\|(Argentinian|Australian|Austrian|Belgian|Belgium|Brazilian|British|Canadian|Dutch|Korean|Chinese|(?:Ph|F)ilipp?in[eo]|Czech|Danish|Finnish|English|French|German|Spanish|Greek|Hungarian|Indian|Irish|Italian|Mexican|Middle\sEastern|(:the\s|)Netherlands|Holland|New\sZealand|Norwegian|Polish|Portuguese|Russian|Scandinavian|Scottish|South\sAfrican|South\sKorean|Swedish|Swiss|Welsh)\]\] (professional |)\[\[(football \(soccer\)|soccer|Association football)(?:\|football|)\]\] (club|\[\[(?:List of football clubs in (?:Argentina|Australia|Austria|Belgium|Brazil|British\sIsles|Canada|the Netherlands|Korea|People's\sRepublic\sof\sChina|the Philippines|Czech\sRepublic|Denmark|Finland|England|France|Germany|Spain|Greece|Hungary|India|Ireland|Italy|Mexico|Holland|New\sZealand|Norway|Poland|Portugal|Russia|Scotland|South\sAfrica|South\sKorea|Sweden|Switzerland|Wales)|:Category:(?:Argentinian|Australian|Austrian|Belgian|Belgium|Brazilian|British|Canadian|Dutch|Korean|Chinese|(?:Ph|F)ilipp?in[eo]|Czech|Danish|Finnish|English|French|German|Spanish|Greek|Hungarian|Indian|Irish|Italian|Mexican|Middle\sEastern|(:the\s|)Netherlands|Holland|New\sZealand|Norwegian|Polish|Portuguese|Russian|Scandinavian|Scottish|South\sAfrican|South\sKorean|Swedish|Swiss|Welsh) football clubs)\|(?:club|team)\]\])/gi, '$3$2 association football club');

//	txt.value=txt.value.replace(/\[\[(foobar)(s|)\]\]/gi, '$1$2'); txt.value=txt.value.replace(/\ba( association football)/gi, 'an$1');

}

function Footy_Premier{ var txt=document.editform.wpTextbox1; //inserting unique id prefix to all script functions txt.value=txt.value.replace(/\[\[(?:Arsenal F.C.\||)(Arsenal)\]\]/gi, '$1'); txt.value=txt.value.replace(/\[\[(?:Aston Villa F.C.\||)(Aston( | )Villa)\]\]/gi, '$1'); txt.value=txt.value.replace(/\[\[(?:Birmingham City F.C.\||)(Birmingham( | )(City|))\]\]/gi, '$1'); txt.value=txt.value.replace(/\[\[(?:Blackburn Rovers F.C.\||)(Blackburn( | )(Rovers|))\]\]/gi, '$1'); txt.value=txt.value.replace(/\[\[(?:Blackpool F.C.\||)(Blackpool)\]\]/gi, '$1'); txt.value=txt.value.replace(/\[\[(?:Bolton Wanderers F.C.\||)(Bolton( | )(Wanderers|))\]\]/gi, '$1'); txt.value=txt.value.replace(/\[\[(?:Chelsea F.C.\||)(Chelsea)\]\]/gi, '$1'); txt.value=txt.value.replace(/\[\[(?:Everton F.C.\||)(Everton)\]\]/gi, '$1'); txt.value=txt.value.replace(/\[\[(?:Fulham F.C.\||)(Fulham)\]\]/gi, '$1'); txt.value=txt.value.replace(/\[\[(?:Liverpool F.C.\||)(Liverpool)\]\]/gi, '$1'); txt.value=txt.value.replace(/\[\[(?:Manchester City F.C.\||)(Manchester( | )City)\]\]/gi, '$1'); txt.value=txt.value.replace(/\[\[(?:Manchester United F.C.\||)(Manchester( | )United)\]\]/gi, '$1'); txt.value=txt.value.replace(/\[\[(?:Newcastle United F.C.\||)(Newcastle( | )(United|))\]\]/gi, '$1'); txt.value=txt.value.replace(/\[\[(?:Stoke City F.C.\||)(Stoke( | )(?:City|))\]\]/gi, '$1'); txt.value=txt.value.replace(/\[\[(?:Sunderland (?:A.|)F.C.\||)(Sunderland)\]\]/gi, '$1'); txt.value=txt.value.replace(/\[\[(?:Tottenham Hotspur F.C.\||)(Tottenham( | )Hotspur|Tottenham|Spurs)\]\]/gi, '$1'); txt.value=txt.value.replace(/\[\[(?:West Bromwich Albion F.C.\||)(West( | )Bromwich( | )(?:Albion|))\]\]/gi, '$1'); txt.value=txt.value.replace(/\[\[(?:West Ham United F.C.\||)(West( | )Ham( | )(United|))\]\]/gi, '$1'); txt.value=txt.value.replace(/\[\[(?:Wigan Athletic F.C.\||)(Wigan( | )Athletic)\]\]/gi, '$1'); txt.value=txt.value.replace(/\[\[(?:Wolverhampton Wanderers F.C.\||)(Wolverhampton( | )(Wanderers|)|Wolves)\]\]/gi, '$1');

txt.value=txt.value.replace(/\[\[(?:Barnsley F.C.\||)(Barnsley)\]\]/gi, '$1'); txt.value=txt.value.replace(/\[\[(?:Bradford City (?:A.|)F.C.\||)(Bradford( | )(?:City|))\]\]/gi, '$1'); txt.value=txt.value.replace(/\[\[(?:Burnley F.C.\||)(Burnley)\]\]/gi, '$1'); txt.value=txt.value.replace(/\[\[(?:Charlton Athletic F.C.\||)(Charlton( | )(?:Athletic|))\]\]/gi, '$1'); txt.value=txt.value.replace(/\[\[(?:Coventry City F.C.\||)(Coventry( | )(?:City|))\]\]/gi, '$1'); txt.value=txt.value.replace(/\[\[(?:Crystal Palace F.C.\||)(Crystal( | )Palace)\]\]/gi, '$1'); txt.value=txt.value.replace(/\[\[(?:Derby County F.C.\||)(Derby( | )County)\]\]/gi, '$1'); txt.value=txt.value.replace(/\[\[(?:Hull City (?:A.|)F.C.\||)(Hull( | )(?:City|))\]\]/gi, '$1'); txt.value=txt.value.replace(/\[\[(?:Ipswich Town F.C.\||)(Ipswich( | )(?:Town|))\]\]/gi, '$1'); txt.value=txt.value.replace(/\[\[(?:Leeds United (?:A.|)F.C.\||)(Leeds( | )(?:United|))\]\]/gi, '$1'); txt.value=txt.value.replace(/\[\[(?:Leicester City F.C.\||)(Leicester( | )(?:City|))\]\]/gi, '$1'); txt.value=txt.value.replace(/\[\[(?:Middlesbrough F.C.\||)(Middlesbrough)\]\]/gi, '$1'); txt.value=txt.value.replace(/\[\[(?:Norwich City F.C.\||)(Norwich( | )(?:City|))\]\]/gi, '$1'); txt.value=txt.value.replace(/\[\[(?:Nottingham Forest F.C.\||)(Nottingham( | )Forest)\]\]/gi, '$1'); txt.value=txt.value.replace(/\[\[(?:Oldham Athletic A.F.C.\||)(Oldham( | )Athletic)\]\]/gi, '$1'); txt.value=txt.value.replace(/\[\[(?:Portsmouth F.C.\||)(Portsmouth)\]\]/gi, '$1'); txt.value=txt.value.replace(/\[\[(?:Queens Park Rangers F.C.\||)(Queens( | )Park( | )Rangers|QPR)\]\]/gi, '$1'); txt.value=txt.value.replace(/\[\[(?:Reading F.C.\||)(Reading)\]\]/gi, '$1'); txt.value=txt.value.replace(/\[\[(?:Sheffield United F.C.\||)(Sheffield( | )United)\]\]/gi, '$1'); txt.value=txt.value.replace(/\[\[(?:Sheffield Wednesday F.C.\||)(Sheffield( | )Wednesday)\]\]/gi, '$1'); txt.value=txt.value.replace(/\[\[(?:Southampton F.C.\||)(Southampton)\]\]/gi, '$1'); txt.value=txt.value.replace(/\[\[(?:Swindon Town F.C.\||)(Swindon( | )(?:Town|))\]\]/gi, '$1'); txt.value=txt.value.replace(/\[\[(?:Watford F.C.\||)(Watford)\]\]/gi, '$1'); txt.value=txt.value.replace(/\[\[(?:Wimbledon F.C.\||)(Wimbledon)\]\]/gi, '$1');

txt.value=txt.value.replace(/\[\[(?:Bristol City F.C.)\|(Bristol( | )(?:City|))\]\]/gi, '$1'); txt.value=txt.value.replace(/\[\[(?:Cardiff City F.C.)\|(Cardiff( | )(?:City|))\]\]/gi, '$1'); txt.value=txt.value.replace(/\[\[(?:Doncaster Rovers F.C.)\|(Doncaster( | )(?:Rovers|))\]\]/gi, '$1'); txt.value=txt.value.replace(/\[\[(?:Millwall F.C.)\|(Milwall)\]\]/gi, '$1'); txt.value=txt.value.replace(/\[\[(?:Preston North End F.C.)\|(Preston North End)\]\]/gi, '$1'); txt.value=txt.value.replace(/\[\[(?:Scunthorpe United F.C.)\|(Scunthorpe( | )(?:United|))\]\]/gi, '$1'); txt.value=txt.value.replace(/\[\[(?:Swansea City (?:A.|)F.C.)\|(Swansea( | )(?:City|))\]\]/gi, '$1'); txt.value=txt.value.replace(/\[\[(?:Watford F.C.)\|(Watford)\]\]/gi, '$1');

txt.value=txt.value.replace(/\[\[(?:Brighton & Hove Albion F.C.)\|(Brighton & Hove Albion)\]\]/gi, '$1'); txt.value=txt.value.replace(/\[\[(?:Colchester United F.C.)\|(Colchester( | )(?:United|))\]\]/gi, '$1'); txt.value=txt.value.replace(/\[\[(?:Crewe Alexandra F.C.)\|(Crewe Alexandra)\]\]/gi, '$1'); txt.value=txt.value.replace(/\[\[(?:Gillingham F.C.)\|(Gillingham)\]\]/gi, '$1'); txt.value=txt.value.replace(/\[\[(?:Luton Town F.C.)\|(Luton( | )(?:Town|))\]\]/gi, '$1'); txt.value=txt.value.replace(/\[\[(?:Peterborough United F.C.)\|(Peterborough( | )(?:United|))\]\]/gi, '$1'); txt.value=txt.value.replace(/\[\[(?:Plymouth Argyle F.C.)\|(Plymouth Argyle)\]\]/gi, '$1'); txt.value=txt.value.replace(/\[\[(?:Rotherham United F.C.)\|(Rotherham( | )(?:United|))\]\]/gi, '$1'); txt.value=txt.value.replace(/\[\[(?:Southend United F.C.)\|(Southend( | )(?:United|))\]\]/gi, '$1');

txt.value=txt.value.replace(/\(((?:[0-2]?\d|30|31)\s(?:Jan(?:uary|\.|)|Feb(?:ruary|\.|)|Mar(?:ch|\.|)|Apr(?:il|\.|)|May\.?|Jun(?:e|\.|)|Jul(?:y|\.|)|Aug(?:ust|\.|)|Sep(?:tember|\.|t\.|)|Oct(?:ober|\.|)|Nov(?:ember|\.|)|Dec(?:ember|\.|)) \d{4})\)/gi, '( \'\'$1\'\' )')

Ohc_football_summary2; } function Ohc_football_summary2{

// Add a tag to the summary box var txt=document.editform.wpSummary; var summary = "hyper-overlinked"; if (txt.value.indexOf(summary) == -1) { if (txt.value.match(/[^\*\/\s][^\/\s]?\s*$/)) { txt.value += " | "; }		txt.value += summary; } //  document.forms.editform.wpMinoredit.checked = true; document.editform.wpDiff.click; }

function Ohc_football_summary { var txt=document.editform.wpTextbox1; Ohc_French_football;

// Add a tag to the summary box var txt=document.editform.wpSummary; var summary = "Consolidate football links"; if (txt.value.indexOf(summary) == -1) { if (txt.value.match(/[^\*\/\s][^\/\s]?\s*$/)) { txt.value += "; "; }		txt.value += summary; }  document.forms.editform.wpMinoredit.checked = true; //  document.editform.wpDiff.click;

} $.when(mw.loader.using('mediawiki.util'), $.ready).done(function { if(document.forms.editform) {  mw.util.addPortletLink('p-tb', 'javascript:Ohc_football', 'Football links', 't-addmetric', 'Fixes some football links', , );  mw.util.addPortletLink('p-tb', 'javascript:Footy_Premier', 'Football Premier', 't-mdy', 'unlinks football premier league clubs', , );  } });