Jump to content

User:Ohconfucius/script/EngvarB.js and Wikipedia:Sandbox: Difference between pages

From Wikipedia, the free encyclopedia
(Difference between pages)
Content deleted Content added
tweaks to increase discriminatory power
 
m assim?
 
Line 8: Line 8:
function protectwords(){
function protectwords(){
var txt=document.editform.wpTextbox1;
var box=document.editform.wpTextbox1;
//txt.value=txt.value.replace(/(\[(?:file|image):[^\.]{0,20})(?:xx)([^\.]{0,20}\.)/g, '$1$2$3');
var txt = box.value;
//txt=txt.replace(/(\[(?:file|image):[^\.]{0,20})(?:xx)([^\.]{0,20}\.)/g, '$1$2$3');
unprotectwords();
unprotectwords();


txt.value=txt.value.replace(/(<.+?>[^<]+?)(al)(uminum)([^<]+?<\/.+?>)/g, '$1$2xXx$3$4');
txt=txt.replace(/(<.+?>[^<]+?)(al)(uminum)([^<]+?<\/.+?>)/g, '$1$2xXx$3$4');
txt.value=txt.value.replace(/(<.+?>[^<]+?)(ar)(tifact)([^<]+?<\/.+?>)/g, '$1$2xXx$3$4');
txt=txt.replace(/(<.+?>[^<]+?)(ar)(tifact)([^<]+?<\/.+?>)/g, '$1$2xXx$3$4');
txt.value=txt.value.replace(/(<.+?>[^<]+?)(ana|cata|hydro|para)(lyz)([^<]+?<\/.+?>)/g, '$1$2xXx$3$4');
txt=txt.replace(/(<.+?>[^<]+?)(ana|cata|hydro|para)(lyz)([^<]+?<\/.+?>)/g, '$1$2xXx$3$4');
txt.value=txt.value.replace(/(<.+?>[^<]+?)(ly)(zing)([^<]+?<\/.+?>)/g, '$1$2xXx$3$4');
txt=txt.replace(/(<.+?>[^<]+?)(ly)(zing)([^<]+?<\/.+?>)/g, '$1$2xXx$3$4');
txt.value=txt.value.replace(/(<.+?>[^<]+?)(di)(arrhea)([^<]+?<\/.+?>)/g, '$1$2xXx$3$4');
txt=txt.replace(/(<.+?>[^<]+?)(di)(arrhea)([^<]+?<\/.+?>)/g, '$1$2xXx$3$4');
txt.value=txt.value.replace(/(<.+?>[^<]+?)(de)(fense)([^<]+?<\/.+?>)/g, '$1$2xXx$3$4');
txt=txt.replace(/(<.+?>[^<]+?)(de)(fense)([^<]+?<\/.+?>)/g, '$1$2xXx$3$4');
txt.value=txt.value.replace(/(<.+?>[^<]+?)(of)(fense)([^<]+?<\/.+?>)/g, '$1$2xXx$3$4');
txt=txt.replace(/(<.+?>[^<]+?)(of)(fense)([^<]+?<\/.+?>)/g, '$1$2xXx$3$4');
txt.value=txt.value.replace(/(<.+?>[^<]+?)(fu)(ror)([^<]+?<\/.+?>)/g, '$1$2xXx$3$4');
txt=txt.replace(/(<.+?>[^<]+?)(fu)(ror)([^<]+?<\/.+?>)/g, '$1$2xXx$3$4');
txt.value=txt.value.replace(/(<.+?>[^<]+?)(gr)(ay)([^<]+?<\/.+?>)/g, '$1$2xXx$3$4');
txt=txt.replace(/(<.+?>[^<]+?)(gr)(ay)([^<]+?<\/.+?>)/g, '$1$2xXx$3$4');
txt.value=txt.value.replace(/(<.+?>[^<]+?)(je)(welry)([^<]+?<\/.+?>)/g, '$1$2xXx$3$4');
txt=txt.replace(/(<.+?>[^<]+?)(je)(welry)([^<]+?<\/.+?>)/g, '$1$2xXx$3$4');
txt.value=txt.value.replace(/(<.+?>[^<]+?)(ma)(neuver)([^<]+?<\/.+?>)/g, '$1$2xXx$3$4');
txt=txt.replace(/(<.+?>[^<]+?)(ma)(neuver)([^<]+?<\/.+?>)/g, '$1$2xXx$3$4');
txt.value=txt.value.replace(/(<.+?>[^<]+?)(pe)(diatric)([^<]+?<\/.+?>)/g, '$1$2xXx$3$4');
txt=txt.replace(/(<.+?>[^<]+?)(pe)(diatric)([^<]+?<\/.+?>)/g, '$1$2xXx$3$4');
txt.value=txt.value.replace(/(<.+?>[^<]+?)(pe)(dophil)([^<]+?<\/.+?>)/g, '$1$2xXx$3$4');
txt=txt.replace(/(<.+?>[^<]+?)(pe)(dophil)([^<]+?<\/.+?>)/g, '$1$2xXx$3$4');
txt.value=txt.value.replace(/(<.+?>[^<]+?)(sk)(eptic)([^<]+?<\/.+?>)/g, '$1$2xXx$3$4');
txt=txt.replace(/(<.+?>[^<]+?)(sk)(eptic)([^<]+?<\/.+?>)/g, '$1$2xXx$3$4');
txt.value=txt.value.replace(/(<.+?>[^<]+?)(va)(por)([^<]+?<\/.+?>)/g, '$1$2xXx$3$4');
txt=txt.replace(/(<.+?>[^<]+?)(va)(por)([^<]+?<\/.+?>)/g, '$1$2xXx$3$4');
txt.value=txt.value.replace(/(<.+?>[^<]+?)(on)(stage)([^<]+?<\/.+?>)/g, '$1$2xXx$3$4');
txt=txt.replace(/(<.+?>[^<]+?)(on)(stage)([^<]+?<\/.+?>)/g, '$1$2xXx$3$4');
txt.value=txt.value.replace(/(<.+?>[^<]+?)(break|clean|lock|pick)(up)([^<]+?<\/.+?>)/g, '$1$2xXx$3$4');
txt=txt.replace(/(<.+?>[^<]+?)(break|clean|lock|pick)(up)([^<]+?<\/.+?>)/g, '$1$2xXx$3$4');
txt.value=txt.value.replace(/(<.+?>[^<]+?)(he)(mo)([^<]+?<\/.+?>)/g, '$1$2xXx$3$4');
txt=txt.replace(/(<.+?>[^<]+?)(he)(mo)([^<]+?<\/.+?>)/g, '$1$2xXx$3$4');
txt.value=txt.value.replace(/(<.+?>[^<]+?)(or)(thopedic)([^<]+?<\/.+?>)/g, '$1$2xXx$3$4');
txt=txt.replace(/(<.+?>[^<]+?)(or)(thopedic)([^<]+?<\/.+?>)/g, '$1$2xXx$3$4');
txt.value=txt.value.replace(/(<.+?>[^<]+?)(ar)(cheo)([^<]+?<\/.+?>)/g, '$1$2xXx$3$4');
txt=txt.replace(/(<.+?>[^<]+?)(ar)(cheo)([^<]+?<\/.+?>)/g, '$1$2xXx$3$4');
txt.value=txt.value.replace(/(<.+?>[^<]+?)(pa)(leonto)([^<]+?<\/.+?>)/g, '$1$2xXx$3$4');
txt=txt.replace(/(<.+?>[^<]+?)(pa)(leonto)([^<]+?<\/.+?>)/g, '$1$2xXx$3$4');
txt.value=txt.value.replace(/(<.+?>[^<]+?)(en)(ology)([^<]+?<\/.+?>)/g, '$1$2xXx$3$4');
txt=txt.replace(/(<.+?>[^<]+?)(en)(ology)([^<]+?<\/.+?>)/g, '$1$2xXx$3$4');
txt.value=txt.value.replace(/(<.+?>[^<]+?)(es)(ophag)([^<]+?<\/.+?>)/g, '$1$2xXx$3$4');
txt=txt.replace(/(<.+?>[^<]+?)(es)(ophag)([^<]+?<\/.+?>)/g, '$1$2xXx$3$4');
txt.value=txt.value.replace(/(<.+?>[^<]+?)(es)(trogen)([^<]+?<\/.+?>)/g, '$1$2xXx$3$4');
txt=txt.replace(/(<.+?>[^<]+?)(es)(trogen)([^<]+?<\/.+?>)/g, '$1$2xXx$3$4');
txt.value=txt.value.replace(/(<.+?>[^<]+?)(es)(thetic)([^<]+?<\/.+?>)/g, '$1$2xXx$3$4');
txt=txt.replace(/(<.+?>[^<]+?)(es)(thetic)([^<]+?<\/.+?>)/g, '$1$2xXx$3$4');
txt.value=txt.value.replace(/(<.+?>[^<]+?)(ho)(meopath)([^<]+?<\/.+?>)/g, '$1$2xXx$3$4');
txt=txt.replace(/(<.+?>[^<]+?)(ho)(meopath)([^<]+?<\/.+?>)/g, '$1$2xXx$3$4');
txt.value=txt.value.replace(/(<.+?>[^<]+?)(me)(dieval)([^<]+?<\/.+?>)/g, '$1$2xXx$3$4');
txt=txt.replace(/(<.+?>[^<]+?)(me)(dieval)([^<]+?<\/.+?>)/g, '$1$2xXx$3$4');
txt.value=txt.value.replace(/(<.+?>[^<]+?)(ri)(gor)([^<]+?<\/.+?>)/g, '$1$2xXx$3$4');
txt=txt.replace(/(<.+?>[^<]+?)(ri)(gor)([^<]+?<\/.+?>)/g, '$1$2xXx$3$4');
txt.value=txt.value.replace(/(<.+?>[^<]+?)(an|leuk|septic|tox)(emi)([^<]+?<\/.+?>)/g, '$1$2xXx$3$4');
txt=txt.replace(/(<.+?>[^<]+?)(an|leuk|septic|tox)(emi)([^<]+?<\/.+?>)/g, '$1$2xXx$3$4');
txt.value=txt.value.replace(/(<.+?>[^<]+?)(su)(lfur)([^<]+?<\/.+?>)/g, '$1$2xXx$3$4');
txt=txt.replace(/(<.+?>[^<]+?)(su)(lfur)([^<]+?<\/.+?>)/g, '$1$2xXx$3$4');
txt.value=txt.value.replace(/(<.+?>[^<]+?)(lik|liv|rat|sal|siz|shak)(able)([^<]+?<\/.+?>)/g, '$1$2xXx$3$4');
txt=txt.replace(/(<.+?>[^<]+?)(lik|liv|rat|sal|siz|shak)(able)([^<]+?<\/.+?>)/g, '$1$2xXx$3$4');
txt.value=txt.value.replace(/(<.+?>[^<]+?)(clam|glam|harb|neighb|rum|savi?)(or)([^<]+?<\/.+?>)/g, '$1$2xXx$3$4');
txt=txt.replace(/(<.+?>[^<]+?)(clam|glam|harb|neighb|rum|savi?)(or)([^<]+?<\/.+?>)/g, '$1$2xXx$3$4');
txt.value=txt.value.replace(/(<.+?>[^<]+?)(behavi|col|fl?av|hon|hum|lab)(or)([^<]+?<\/.+?>)/g, '$1$2xXx$3$4');
txt=txt.replace(/(<.+?>[^<]+?)(behavi|col|fl?av|hon|hum|lab)(or)([^<]+?<\/.+?>)/g, '$1$2xXx$3$4');
txt.value=txt.value.replace(/(<.+?>[^<]+?)(mo)(ld)([^<]+?<\/.+?>)/g, '$1$2xXx$3$4');
txt=txt.replace(/(<.+?>[^<]+?)(mo)(ld)([^<]+?<\/.+?>)/g, '$1$2xXx$3$4');
txt.value=txt.value.replace(/(<.+?>[^<]+?)(calib|fib|goit|lust|mit|nit|reconnoit|sab|saltpet|spect|theat|tit)(er)([^<]+?<\/.+?>)/g, '$1$2xXx$3$4');
txt=txt.replace(/(<.+?>[^<]+?)(calib|fib|goit|lust|mit|nit|reconnoit|sab|saltpet|spect|theat|tit)(er)([^<]+?<\/.+?>)/g, '$1$2xXx$3$4');
txt.value=txt.value.replace(/(<.+?>[^<]+?)(cent|epicent|recent)(er)([^<]+?<\/.+?>)/g, '$1$2xXx$3$4');
txt=txt.replace(/(<.+?>[^<]+?)(cent|epicent|recent)(er)([^<]+?<\/.+?>)/g, '$1$2xXx$3$4');
txt.value=txt.value.replace(/(<.+?>[^<]+?)(centi|kilo|milli|\d\s)(meter)([^<]+?<\/.+?>)/g, '$1$2xXx$3$4');
txt=txt.replace(/(<.+?>[^<]+?)(centi|kilo|milli|\d\s)(meter)([^<]+?<\/.+?>)/g, '$1$2xXx$3$4');
txt.value=txt.value.replace(/(<.+?>[^<]+?)(centi|milli|deci|pico|hecto)(liter)([^<]+?<\/.+?>)/g, '$1$2xXx$3$4');
txt=txt.replace(/(<.+?>[^<]+?)(centi|milli|deci|pico|hecto)(liter)([^<]+?<\/.+?>)/g, '$1$2xXx$3$4');
txt.value=txt.value.replace(/(<.+?>[^<]+?)(dema|peda|mono|syna)(gog)([^<]+?<\/.+?>)/g, '$1$2xXx$3$4');
txt=txt.replace(/(<.+?>[^<]+?)(dema|peda|mono|syna)(gog)([^<]+?<\/.+?>)/g, '$1$2xXx$3$4');
txt.value=txt.value.replace(/(<.+?>[^<]+?)(ana|cata|dia|epi|homo|mono|pro)(log)([^<]+?<\/.+?>)/g, '$1$2xXx$3$4');
txt=txt.replace(/(<.+?>[^<]+?)(ana|cata|dia|epi|homo|mono|pro)(log)([^<]+?<\/.+?>)/g, '$1$2xXx$3$4');
txt.value=txt.value.replace(/(<.+?>[^<]+?)(iz)(e[drs]?|ations?|ing)([^<]+?<\/.+?>)/g, '$1$2xXx$3$4');
txt=txt.replace(/(<.+?>[^<]+?)(iz)(e[drs]?|ations?|ing)([^<]+?<\/.+?>)/g, '$1$2xXx$3$4');
txt.value=txt.value.replace(/(<.+?>[^<]+?)(el)(e[dr]|est|ing)([^<]+?<\/.+?>)/g, '$1$2xXx$3$4');
txt=txt.replace(/(<.+?>[^<]+?)(el)(e[dr]|est|ing)([^<]+?<\/.+?>)/g, '$1$2xXx$3$4');
txt.value=txt.value.replace(/(<.+?>[^<]+?)(counci|dia)(le[dr]|ling|lor)([^<]+?<\/.+?>)/g, '$1$2xXx$3$4');
txt=txt.replace(/(<.+?>[^<]+?)(counci|dia)(le[dr]|ling|lor)([^<]+?<\/.+?>)/g, '$1$2xXx$3$4');
txt.value=txt.value.replace(/(<.+?>[^<]+?)(app|enthr|riv|sign|tot)(ale[dr]|aling)([^<]+?<\/.+?>)/g, '$1$2xXx$3$4');
txt=txt.replace(/(<.+?>[^<]+?)(app|enthr|riv|sign|tot)(ale[dr]|aling)([^<]+?<\/.+?>)/g, '$1$2xXx$3$4');


txt.value=txt.value.replace(/(\[Category:[^\]]*?)(al)(uminum)([^\]]*?\])/g, '$1$2xXx$3$4');
txt=txt.replace(/(\[Category:[^\]]*?)(al)(uminum)([^\]]*?\])/g, '$1$2xXx$3$4');
txt.value=txt.value.replace(/(\[Category:[^\]]*?)(ar)(tifact)([^\]]*?\])/g, '$1$2xXx$3$4');
txt=txt.replace(/(\[Category:[^\]]*?)(ar)(tifact)([^\]]*?\])/g, '$1$2xXx$3$4');
txt.value=txt.value.replace(/(\[Category:[^\]]*?)(ana|cata|hydro|para)(lyz)([^\]]*?\])/g, '$1$2xXx$3$4');
txt=txt.replace(/(\[Category:[^\]]*?)(ana|cata|hydro|para)(lyz)([^\]]*?\])/g, '$1$2xXx$3$4');
txt.value=txt.value.replace(/(\[Category:[^\]]*?)(ly)(zing)([^\]]*?\])/g, '$1$2xXx$3$4');
txt=txt.replace(/(\[Category:[^\]]*?)(ly)(zing)([^\]]*?\])/g, '$1$2xXx$3$4');
//txt.value=txt.value.replace(/(\[Category:[^\]]*?)(di)(arrhea)([^\]]*?\])/g, '$1$2xXx$3$4');
//txt=txt.replace(/(\[Category:[^\]]*?)(di)(arrhea)([^\]]*?\])/g, '$1$2xXx$3$4');
//txt.value=txt.value.replace(/(\[Category:[^\]]*?)(de)(fense)([^\]]*?\])/g, '$1$2xXx$3$4');
//txt=txt.replace(/(\[Category:[^\]]*?)(de)(fense)([^\]]*?\])/g, '$1$2xXx$3$4');
//txt.value=txt.value.replace(/(\[Category:[^\]]*?)(of)(fense)([^\]]*?\])/g, '$1$2xXx$3$4');
//txt=txt.replace(/(\[Category:[^\]]*?)(of)(fense)([^\]]*?\])/g, '$1$2xXx$3$4');
//txt.value=txt.value.replace(/(\[Category:[^\]]*?)(fu)(ror)([^\]]*?\])/g, '$1$2xXx$3$4');
//txt=txt.replace(/(\[Category:[^\]]*?)(fu)(ror)([^\]]*?\])/g, '$1$2xXx$3$4');
txt.value=txt.value.replace(/(\[Category:[^\]]*?)(gr)(ay)([^\]]*?\])/g, '$1$2xXx$3$4');
txt=txt.replace(/(\[Category:[^\]]*?)(gr)(ay)([^\]]*?\])/g, '$1$2xXx$3$4');
txt.value=txt.value.replace(/(\[Category:[^\]]*?)(je)(welry)([^\]]*?\])/g, '$1$2xXx$3$4');
txt=txt.replace(/(\[Category:[^\]]*?)(je)(welry)([^\]]*?\])/g, '$1$2xXx$3$4');
//txt.value=txt.value.replace(/(\[Category:[^\]]*?)(ma)(neuver)([^\]]*?\])/g, '$1$2xXx$3$4');
//txt=txt.replace(/(\[Category:[^\]]*?)(ma)(neuver)([^\]]*?\])/g, '$1$2xXx$3$4');
txt.value=txt.value.replace(/(\[Category:[^\]]*?)(pe)(diatric)([^\]]*?\])/g, '$1$2xXx$3$4');
txt=txt.replace(/(\[Category:[^\]]*?)(pe)(diatric)([^\]]*?\])/g, '$1$2xXx$3$4');
txt.value=txt.value.replace(/(\[Category:[^\]]*?)(pe)(dophil)([^\]]*?\])/g, '$1$2xXx$3$4');
txt=txt.replace(/(\[Category:[^\]]*?)(pe)(dophil)([^\]]*?\])/g, '$1$2xXx$3$4');
txt.value=txt.value.replace(/(\[Category:[^\]]*?)(sk)(eptic)([^\]]*?\])/g, '$1$2xXx$3$4');
txt=txt.replace(/(\[Category:[^\]]*?)(sk)(eptic)([^\]]*?\])/g, '$1$2xXx$3$4');
//txt.value=txt.value.replace(/(\[Category:[^\]]*?)(va)(por)([^\]]*?\])/g, '$1$2xXx$3$4');
//txt=txt.replace(/(\[Category:[^\]]*?)(va)(por)([^\]]*?\])/g, '$1$2xXx$3$4');
//txt.value=txt.value.replace(/(\[Category:[^\]]*?)(on)(stage)([^\]]*?\])/g, '$1$2xXx$3$4');
//txt=txt.replace(/(\[Category:[^\]]*?)(on)(stage)([^\]]*?\])/g, '$1$2xXx$3$4');
//txt.value=txt.value.replace(/(\[Category:[^\]]*?)(break|clean|lock|pick)(up)([^\]]*?\])/g, '$1$2xXx$3$4');
//txt=txt.replace(/(\[Category:[^\]]*?)(break|clean|lock|pick)(up)([^\]]*?\])/g, '$1$2xXx$3$4');
txt.value=txt.value.replace(/(\[Category:[^\]]*?)(he)(mo)([^\]]*?\])/g, '$1$2xXx$3$4');
txt=txt.replace(/(\[Category:[^\]]*?)(he)(mo)([^\]]*?\])/g, '$1$2xXx$3$4');
txt.value=txt.value.replace(/(\[Category:[^\]]*?)(or)(thopedic)([^\]]*?\])/g, '$1$2xXx$3$4');
txt=txt.replace(/(\[Category:[^\]]*?)(or)(thopedic)([^\]]*?\])/g, '$1$2xXx$3$4');
txt.value=txt.value.replace(/(\[Category:[^\]]*?)(ar)(cheo)([^\]]*?\])/g, '$1$2xXx$3$4');
txt=txt.replace(/(\[Category:[^\]]*?)(ar)(cheo)([^\]]*?\])/g, '$1$2xXx$3$4');
txt.value=txt.value.replace(/(\[Category:[^\]]*?)(pa)(leonto)([^\]]*?\])/g, '$1$2xXx$3$4');
txt=txt.replace(/(\[Category:[^\]]*?)(pa)(leonto)([^\]]*?\])/g, '$1$2xXx$3$4');
txt.value=txt.value.replace(/(\[Category:[^\]]*?)(en)(ology)([^\]]*?\])/g, '$1$2xXx$3$4');
txt=txt.replace(/(\[Category:[^\]]*?)(en)(ology)([^\]]*?\])/g, '$1$2xXx$3$4');
//txt.value=txt.value.replace(/(\[Category:[^\]]*?)(es)(ophag)([^\]]*?\])/g, '$1$2xXx$3$4');
//txt=txt.replace(/(\[Category:[^\]]*?)(es)(ophag)([^\]]*?\])/g, '$1$2xXx$3$4');
//txt.value=txt.value.replace(/(\[Category:[^\]]*?)(es)(trogen)([^\]]*?\])/g, '$1$2xXx$3$4');
//txt=txt.replace(/(\[Category:[^\]]*?)(es)(trogen)([^\]]*?\])/g, '$1$2xXx$3$4');
txt.value=txt.value.replace(/(\[Category:[^\]]*?)(es)(thetic)([^\]]*?\])/g, '$1$2xXx$3$4');
txt=txt.replace(/(\[Category:[^\]]*?)(es)(thetic)([^\]]*?\])/g, '$1$2xXx$3$4');
txt.value=txt.value.replace(/(\[Category:[^\]]*?)(ho)(meopath)([^\]]*?\])/g, '$1$2xXx$3$4');
txt=txt.replace(/(\[Category:[^\]]*?)(ho)(meopath)([^\]]*?\])/g, '$1$2xXx$3$4');
txt.value=txt.value.replace(/(\[Category:[^\]]*?)(me)(dieval)([^\]]*?\])/g, '$1$2xXx$3$4');
txt=txt.replace(/(\[Category:[^\]]*?)(me)(dieval)([^\]]*?\])/g, '$1$2xXx$3$4');
//txt.value=txt.value.replace(/(\[Category:[^\]]*?)(ri)(gor)([^\]]*?\])/g, '$1$2xXx$3$4');
//txt=txt.replace(/(\[Category:[^\]]*?)(ri)(gor)([^\]]*?\])/g, '$1$2xXx$3$4');
txt.value=txt.value.replace(/(\[Category:[^\]]*?)(an|leuk|septic|tox)(emi)([^\]]*?\])/g, '$1$2xXx$3$4');
txt=txt.replace(/(\[Category:[^\]]*?)(an|leuk|septic|tox)(emi)([^\]]*?\])/g, '$1$2xXx$3$4');
txt.value=txt.value.replace(/(\[Category:[^\]]*?)(su)(lfur)([^\]]*?\])/g, '$1$2xXx$3$4');
txt=txt.replace(/(\[Category:[^\]]*?)(su)(lfur)([^\]]*?\])/g, '$1$2xXx$3$4');
//txt.value=txt.value.replace(/(\[Category:[^\]]*?)(lik|liv|rat|sal|siz|shak)(able)([^\]]*?\])/g, '$1$2xXx$3$4');
//txt=txt.replace(/(\[Category:[^\]]*?)(lik|liv|rat|sal|siz|shak)(able)([^\]]*?\])/g, '$1$2xXx$3$4');
txt.value=txt.value.replace(/(\[Category:[^\]]*?)(clam|glam|harb|neighb|rum|savi?)(or)([^\]]*?\])/g, '$1$2xXx$3$4');
txt=txt.replace(/(\[Category:[^\]]*?)(clam|glam|harb|neighb|rum|savi?)(or)([^\]]*?\])/g, '$1$2xXx$3$4');
txt.value=txt.value.replace(/(\[Category:[^\]]*?)(behavi|col|fl?av|hon|hum|lab)(or)([^\]]*?\])/g, '$1$2xXx$3$4');
txt=txt.replace(/(\[Category:[^\]]*?)(behavi|col|fl?av|hon|hum|lab)(or)([^\]]*?\])/g, '$1$2xXx$3$4');
txt.value=txt.value.replace(/(\[Category:[^\]]*?)(mo)(ld)([^\]]*?\])/g, '$1$2xXx$3$4');
txt=txt.replace(/(\[Category:[^\]]*?)(mo)(ld)([^\]]*?\])/g, '$1$2xXx$3$4');
//txt.value=txt.value.replace(/(\[Category:[^\]]*?)(calib|fib|goit|lust|mit|nit|reconnoit|sab|saltpet|spect|theat|tit)(er)([^\]]*?\])/g, '$1$2xXx$3$4');
//txt=txt.replace(/(\[Category:[^\]]*?)(calib|fib|goit|lust|mit|nit|reconnoit|sab|saltpet|spect|theat|tit)(er)([^\]]*?\])/g, '$1$2xXx$3$4');
txt.value=txt.value.replace(/(\[Category:[^\]]*?)(cent|epicent|recent)(er)([^\]]*?\])/g, '$1$2xXx$3$4');
txt=txt.replace(/(\[Category:[^\]]*?)(cent|epicent|recent)(er)([^\]]*?\])/g, '$1$2xXx$3$4');
//txt.value=txt.value.replace(/(\[Category:[^\]]*?)(centi|kilo|milli|\d\s)(meter)([^\]]*?\])/g, '$1$2xXx$3$4');
//txt=txt.replace(/(\[Category:[^\]]*?)(centi|kilo|milli|\d\s)(meter)([^\]]*?\])/g, '$1$2xXx$3$4');
//txt.value=txt.value.replace(/(\[Category:[^\]]*?)(centi|milli|deci|pico|hecto)(liter)([^\]]*?\])/g, '$1$2xXx$3$4');
//txt=txt.replace(/(\[Category:[^\]]*?)(centi|milli|deci|pico|hecto)(liter)([^\]]*?\])/g, '$1$2xXx$3$4');
txt.value=txt.value.replace(/(\[Category:[^\]]*?)(dema|peda|mono|syna)(gog)([^\]]*?\])/g, '$1$2xXx$3$4');
txt=txt.replace(/(\[Category:[^\]]*?)(dema|peda|mono|syna)(gog)([^\]]*?\])/g, '$1$2xXx$3$4');
txt.value=txt.value.replace(/(\[Category:[^\]]*?)(ana|cata|dia|epi|homo|mono|pro)(log)([^\]]*?\])/g, '$1$2xXx$3$4');
txt=txt.replace(/(\[Category:[^\]]*?)(ana|cata|dia|epi|homo|mono|pro)(log)([^\]]*?\])/g, '$1$2xXx$3$4');
txt.value=txt.value.replace(/(\[Category:[^\]]*?)(iz)(e[drs]?|ations?|ing)([^\]]*?\])/g, '$1$2xXx$3$4');
txt=txt.replace(/(\[Category:[^\]]*?)(iz)(e[drs]?|ations?|ing)([^\]]*?\])/g, '$1$2xXx$3$4');
txt.value=txt.value.replace(/(\[Category:[^\]]*?)(el)(e[dr]|est|ing)([^\]]*?\])/g, '$1$2xXx$3$4');
txt=txt.replace(/(\[Category:[^\]]*?)(el)(e[dr]|est|ing)([^\]]*?\])/g, '$1$2xXx$3$4');
txt.value=txt.value.replace(/(\[Category:[^\]]*?)(counci|dia)(le[dr]|ling|lor)([^\]]*?\])/g, '$1$2xXx$3$4');
txt=txt.replace(/(\[Category:[^\]]*?)(counci|dia)(le[dr]|ling|lor)([^\]]*?\])/g, '$1$2xXx$3$4');
//txt.value=txt.value.replace(/(\[Category:[^\]]*?)(app|enthr|riv|sign|tot)(ale[dr]|aling)([^\]]*?\])/g, '$1$2xXx$3$4');
//txt=txt.replace(/(\[Category:[^\]]*?)(app|enthr|riv|sign|tot)(ale[dr]|aling)([^\]]*?\])/g, '$1$2xXx$3$4');


txt.value=txt.value.replace(/(\[(?:file|image):[^\.]{0,20})(al)(uminum)([^\.]{0,20}\.)/g, '$1$2xXx$3$4');
txt=txt.replace(/(\[(?:file|image):[^\.]{0,20})(al)(uminum)([^\.]{0,20}\.)/g, '$1$2xXx$3$4');
txt.value=txt.value.replace(/(\[(?:file|image):[^\.]{0,20})(ar)(tifact)([^\.]{0,20}\.)/g, '$1$2xXx$3$4');
txt=txt.replace(/(\[(?:file|image):[^\.]{0,20})(ar)(tifact)([^\.]{0,20}\.)/g, '$1$2xXx$3$4');
txt.value=txt.value.replace(/(\[(?:file|image):[^\.]{0,20})(ana|cata|hydro|para)(lyz)([^\.]{0,20}\.)/g, '$1$2xXx$3$4');
txt=txt.replace(/(\[(?:file|image):[^\.]{0,20})(ana|cata|hydro|para)(lyz)([^\.]{0,20}\.)/g, '$1$2xXx$3$4');
txt.value=txt.value.replace(/(\[(?:file|image):[^\.]{0,20})(ly)(zing)([^\.]{0,20}\.)/g, '$1$2xXx$3$4');
txt=txt.replace(/(\[(?:file|image):[^\.]{0,20})(ly)(zing)([^\.]{0,20}\.)/g, '$1$2xXx$3$4');
txt.value=txt.value.replace(/(\[(?:file|image):[^\.]{0,20})(di)(arrhea)([^\.]{0,20}\.)/g, '$1$2xXx$3$4');
txt=txt.replace(/(\[(?:file|image):[^\.]{0,20})(di)(arrhea)([^\.]{0,20}\.)/g, '$1$2xXx$3$4');
txt.value=txt.value.replace(/(\[(?:file|image):[^\.]{0,20})(de)(fense)([^\.]{0,20}\.)/g, '$1$2xXx$3$4');
txt=txt.replace(/(\[(?:file|image):[^\.]{0,20})(de)(fense)([^\.]{0,20}\.)/g, '$1$2xXx$3$4');
txt.value=txt.value.replace(/(\[(?:file|image):[^\.]{0,20})(of)(fense)([^\.]{0,20}\.)/g, '$1$2xXx$3$4');
txt=txt.replace(/(\[(?:file|image):[^\.]{0,20})(of)(fense)([^\.]{0,20}\.)/g, '$1$2xXx$3$4');
txt.value=txt.value.replace(/(\[(?:file|image):[^\.]{0,20})(fu)(ror)([^\.]{0,20}\.)/g, '$1$2xXx$3$4');
txt=txt.replace(/(\[(?:file|image):[^\.]{0,20})(fu)(ror)([^\.]{0,20}\.)/g, '$1$2xXx$3$4');
txt.value=txt.value.replace(/(\[(?:file|image):[^\.]{0,20})(gr)(ay)([^\.]{0,20}\.)/g, '$1$2xXx$3$4');
txt=txt.replace(/(\[(?:file|image):[^\.]{0,20})(gr)(ay)([^\.]{0,20}\.)/g, '$1$2xXx$3$4');
txt.value=txt.value.replace(/(\[(?:file|image):[^\.]{0,20})(je)(welry)([^\.]{0,20}\.)/g, '$1$2xXx$3$4');
txt=txt.replace(/(\[(?:file|image):[^\.]{0,20})(je)(welry)([^\.]{0,20}\.)/g, '$1$2xXx$3$4');
txt.value=txt.value.replace(/(\[(?:file|image):[^\.]{0,20})(ma)(neuver)([^\.]{0,20}\.)/g, '$1$2xXx$3$4');
txt=txt.replace(/(\[(?:file|image):[^\.]{0,20})(ma)(neuver)([^\.]{0,20}\.)/g, '$1$2xXx$3$4');
txt.value=txt.value.replace(/(\[(?:file|image):[^\.]{0,20})(pe)(diatric)([^\.]{0,20}\.)/g, '$1$2xXx$3$4');
txt=txt.replace(/(\[(?:file|image):[^\.]{0,20})(pe)(diatric)([^\.]{0,20}\.)/g, '$1$2xXx$3$4');
txt.value=txt.value.replace(/(\[(?:file|image):[^\.]{0,20})(pe)(dophil)([^\.]{0,20}\.)/g, '$1$2xXx$3$4');
txt=txt.replace(/(\[(?:file|image):[^\.]{0,20})(pe)(dophil)([^\.]{0,20}\.)/g, '$1$2xXx$3$4');
txt.value=txt.value.replace(/(\[(?:file|image):[^\.]{0,20})(sk)(eptic)([^\.]{0,20}\.)/g, '$1$2xXx$3$4');
txt=txt.replace(/(\[(?:file|image):[^\.]{0,20})(sk)(eptic)([^\.]{0,20}\.)/g, '$1$2xXx$3$4');
txt.value=txt.value.replace(/(\[(?:file|image):[^\.]{0,20})(va)(por)([^\.]{0,20}\.)/g, '$1$2xXx$3$4');
txt=txt.replace(/(\[(?:file|image):[^\.]{0,20})(va)(por)([^\.]{0,20}\.)/g, '$1$2xXx$3$4');
txt.value=txt.value.replace(/(\[(?:file|image):[^\.]{0,20})(on)(stage)([^\.]{0,20}\.)/g, '$1$2xXx$3$4');
txt=txt.replace(/(\[(?:file|image):[^\.]{0,20})(on)(stage)([^\.]{0,20}\.)/g, '$1$2xXx$3$4');
txt.value=txt.value.replace(/(\[(?:file|image):[^\.]{0,20})(break|clean|lock|pick)(up)([^\.]{0,20}\.)/g, '$1$2xXx$3$4');
txt=txt.replace(/(\[(?:file|image):[^\.]{0,20})(break|clean|lock|pick)(up)([^\.]{0,20}\.)/g, '$1$2xXx$3$4');
txt.value=txt.value.replace(/(\[(?:file|image):[^\.]{0,20})(he)(mo)([^\.]{0,20}\.)/g, '$1$2xXx$3$4');
txt=txt.replace(/(\[(?:file|image):[^\.]{0,20})(he)(mo)([^\.]{0,20}\.)/g, '$1$2xXx$3$4');
txt.value=txt.value.replace(/(\[(?:file|image):[^\.]{0,20})(or)(thopedic)([^\.]{0,20}\.)/g, '$1$2xXx$3$4');
txt=txt.replace(/(\[(?:file|image):[^\.]{0,20})(or)(thopedic)([^\.]{0,20}\.)/g, '$1$2xXx$3$4');
txt.value=txt.value.replace(/(\[(?:file|image):[^\.]{0,20})(ar)(cheo)([^\.]{0,20}\.)/g, '$1$2xXx$3$4');
txt=txt.replace(/(\[(?:file|image):[^\.]{0,20})(ar)(cheo)([^\.]{0,20}\.)/g, '$1$2xXx$3$4');
txt.value=txt.value.replace(/(\[(?:file|image):[^\.]{0,20})(pa)(leonto)([^\.]{0,20}\.)/g, '$1$2xXx$3$4');
txt=txt.replace(/(\[(?:file|image):[^\.]{0,20})(pa)(leonto)([^\.]{0,20}\.)/g, '$1$2xXx$3$4');
txt.value=txt.value.replace(/(\[(?:file|image):[^\.]{0,20})(en)(ology)([^\.]{0,20}\.)/g, '$1$2xXx$3$4');
txt=txt.replace(/(\[(?:file|image):[^\.]{0,20})(en)(ology)([^\.]{0,20}\.)/g, '$1$2xXx$3$4');
txt.value=txt.value.replace(/(\[(?:file|image):[^\.]{0,20})(es)(ophag)([^\.]{0,20}\.)/g, '$1$2xXx$3$4');
txt=txt.replace(/(\[(?:file|image):[^\.]{0,20})(es)(ophag)([^\.]{0,20}\.)/g, '$1$2xXx$3$4');
txt.value=txt.value.replace(/(\[(?:file|image):[^\.]{0,20})(es)(trogen)([^\.]{0,20}\.)/g, '$1$2xXx$3$4');
txt=txt.replace(/(\[(?:file|image):[^\.]{0,20})(es)(trogen)([^\.]{0,20}\.)/g, '$1$2xXx$3$4');
txt.value=txt.value.replace(/(\[(?:file|image):[^\.]{0,20})(es)(thetic)([^\.]{0,20}\.)/g, '$1$2xXx$3$4');
txt=txt.replace(/(\[(?:file|image):[^\.]{0,20})(es)(thetic)([^\.]{0,20}\.)/g, '$1$2xXx$3$4');
txt.value=txt.value.replace(/(\[(?:file|image):[^\.]{0,20})(ho)(meopath)([^\.]{0,20}\.)/g, '$1$2xXx$3$4');
txt=txt.replace(/(\[(?:file|image):[^\.]{0,20})(ho)(meopath)([^\.]{0,20}\.)/g, '$1$2xXx$3$4');
txt.value=txt.value.replace(/(\[(?:file|image):[^\.]{0,20})(me)(dieval)([^\.]{0,20}\.)/g, '$1$2xXx$3$4');
txt=txt.replace(/(\[(?:file|image):[^\.]{0,20})(me)(dieval)([^\.]{0,20}\.)/g, '$1$2xXx$3$4');
txt.value=txt.value.replace(/(\[(?:file|image):[^\.]{0,20})(ri)(gor)([^\.]{0,20}\.)/g, '$1$2xXx$3$4');
txt=txt.replace(/(\[(?:file|image):[^\.]{0,20})(ri)(gor)([^\.]{0,20}\.)/g, '$1$2xXx$3$4');
txt.value=txt.value.replace(/(\[(?:file|image):[^\.]{0,20})(an|leuk|septic|tox)(emi)([^\.]{0,20}\.)/g, '$1$2xXx$3$4');
txt=txt.replace(/(\[(?:file|image):[^\.]{0,20})(an|leuk|septic|tox)(emi)([^\.]{0,20}\.)/g, '$1$2xXx$3$4');
txt.value=txt.value.replace(/(\[(?:file|image):[^\.]{0,20})(su)(lfur)([^\.]{0,20}\.)/g, '$1$2xXx$3$4');
txt=txt.replace(/(\[(?:file|image):[^\.]{0,20})(su)(lfur)([^\.]{0,20}\.)/g, '$1$2xXx$3$4');
txt.value=txt.value.replace(/(\[(?:file|image):[^\.]{0,20})(lik|liv|rat|sal|siz|shak)(able)([^\.]{0,20}\.)/g, '$1$2xXx$3$4');
txt=txt.replace(/(\[(?:file|image):[^\.]{0,20})(lik|liv|rat|sal|siz|shak)(able)([^\.]{0,20}\.)/g, '$1$2xXx$3$4');
txt.value=txt.value.replace(/(\[(?:file|image):[^\.]{0,20})(clam|glam|harb|neighb|rum|savi?)(or)([^\.]{0,20}\.)/g, '$1$2xXx$3$4');
txt=txt.replace(/(\[(?:file|image):[^\.]{0,20})(clam|glam|harb|neighb|rum|savi?)(or)([^\.]{0,20}\.)/g, '$1$2xXx$3$4');
txt.value=txt.value.replace(/(\[(?:file|image):[^\.]{0,20})(behavi|col|fl?av|hon|hum|lab)(or)([^\.]{0,20}\.)/g, '$1$2xXx$3$4');
txt=txt.replace(/(\[(?:file|image):[^\.]{0,20})(behavi|col|fl?av|hon|hum|lab)(or)([^\.]{0,20}\.)/g, '$1$2xXx$3$4');
txt.value=txt.value.replace(/(\[(?:file|image):[^\.]{0,20})(mo)(ld)([^\.]{0,20}\.)/g, '$1$2xXx$3$4');
txt=txt.replace(/(\[(?:file|image):[^\.]{0,20})(mo)(ld)([^\.]{0,20}\.)/g, '$1$2xXx$3$4');
txt.value=txt.value.replace(/(\[(?:file|image):[^\.]{0,20})(calib|fib|goit|lust|mit|nit|reconnoit|sab|saltpet|spect|theat|tit)(er)([^\.]{0,20}\.)/g, '$1$2xXx$3$4');
txt=txt.replace(/(\[(?:file|image):[^\.]{0,20})(calib|fib|goit|lust|mit|nit|reconnoit|sab|saltpet|spect|theat|tit)(er)([^\.]{0,20}\.)/g, '$1$2xXx$3$4');
txt.value=txt.value.replace(/(\[(?:file|image):[^\.]{0,20})(cent|epicent|recent)(er)([^\.]{0,20}\.)/g, '$1$2xXx$3$4');
txt=txt.replace(/(\[(?:file|image):[^\.]{0,20})(cent|epicent|recent)(er)([^\.]{0,20}\.)/g, '$1$2xXx$3$4');
txt.value=txt.value.replace(/(\[(?:file|image):[^\.]{0,20})(centi|kilo|milli|\d\s)(meter)([^\.]{0,20}\.)/g, '$1$2xXx$3$4');
txt=txt.replace(/(\[(?:file|image):[^\.]{0,20})(centi|kilo|milli|\d\s)(meter)([^\.]{0,20}\.)/g, '$1$2xXx$3$4');
txt.value=txt.value.replace(/(\[(?:file|image):[^\.]{0,20})(centi|milli|deci|pico|hecto)(liter)([^\.]{0,20}\.)/g, '$1$2xXx$3$4');
txt=txt.replace(/(\[(?:file|image):[^\.]{0,20})(centi|milli|deci|pico|hecto)(liter)([^\.]{0,20}\.)/g, '$1$2xXx$3$4');
txt.value=txt.value.replace(/(\[(?:file|image):[^\.]{0,20})(dema|peda|mono|syna)(gog)([^\.]{0,20}\.)/g, '$1$2xXx$3$4');
txt=txt.replace(/(\[(?:file|image):[^\.]{0,20})(dema|peda|mono|syna)(gog)([^\.]{0,20}\.)/g, '$1$2xXx$3$4');
txt.value=txt.value.replace(/(\[(?:file|image):[^\.]{0,20})(ana|cata|dia|epi|homo|mono|pro)(log)([^\.]{0,20}\.)/g, '$1$2xXx$3$4');
txt=txt.replace(/(\[(?:file|image):[^\.]{0,20})(ana|cata|dia|epi|homo|mono|pro)(log)([^\.]{0,20}\.)/g, '$1$2xXx$3$4');
txt.value=txt.value.replace(/(\[(?:file|image):[^\.]{0,20})(iz)(e[drs]?|ations?|ing)([^\.]{0,20}\.)/g, '$1$2xXx$3$4');
txt=txt.replace(/(\[(?:file|image):[^\.]{0,20})(iz)(e[drs]?|ations?|ing)([^\.]{0,20}\.)/g, '$1$2xXx$3$4');
txt.value=txt.value.replace(/(\[(?:file|image):[^\.]{0,20})(bev|jew|lev|mod|rev|trav)(el)([^\.]{0,20}\.)/g, '$1$2xXx$3$4');
txt=txt.replace(/(\[(?:file|image):[^\.]{0,20})(bev|jew|lev|mod|rev|trav)(el)([^\.]{0,20}\.)/g, '$1$2xXx$3$4');
txt.value=txt.value.replace(/(\[(?:file|image):[^\.]{0,20})([a-z]{2,8}[^egl\b])(el)([^\.]{0,20}\.)/g, '$1$2xXx$3$4');
txt=txt.replace(/(\[(?:file|image):[^\.]{0,20})([a-z]{2,8}[^egl\b])(el)([^\.]{0,20}\.)/g, '$1$2xXx$3$4');
txt.value=txt.value.replace(/(\[(?:file|image):[^\.]{0,20})(counci|dia)(le[dr]|ling|lor)([^\.]{0,20}\.)/g, '$1$2xXx$3$4');
txt=txt.replace(/(\[(?:file|image):[^\.]{0,20})(counci|dia)(le[dr]|ling|lor)([^\.]{0,20}\.)/g, '$1$2xXx$3$4');
txt.value=txt.value.replace(/(\[(?:file|image):[^\.]{0,20})(app|enthr|riv|sign|tot)(ale[dr]|aling)([^\.]{0,20}\.)/g, '$1$2xXx$3$4');
txt=txt.replace(/(\[(?:file|image):[^\.]{0,20})(app|enthr|riv|sign|tot)(ale[dr]|aling)([^\.]{0,20}\.)/g, '$1$2xXx$3$4');
//protection for quotations in templates
//protection for quotations in templates
txt.value=txt.value.replace(/({[^{]{0,6}quot[^\|]{1,7}\s?\|[^}]*?)(al)(uminum)([^}]*?})/g, '$1$2xXx$3$4');
txt=txt.replace(/({[^{]{0,6}quot[^\|]{1,7}\s?\|[^}]*?)(al)(uminum)([^}]*?})/g, '$1$2xXx$3$4');
txt.value=txt.value.replace(/({[^{]{0,6}quot[^\|]{1,7}\s?\|[^}]*?)(ar)(tifact)([^}]*?})/g, '$1$2xXx$3$4');
txt=txt.replace(/({[^{]{0,6}quot[^\|]{1,7}\s?\|[^}]*?)(ar)(tifact)([^}]*?})/g, '$1$2xXx$3$4');
txt.value=txt.value.replace(/({[^{]{0,6}quot[^\|]{1,7}\s?\|[^}]*?)(ana|cata|hydro|para)(lyz)([^}]*?})/g, '$1$2xXx$3$4');
txt=txt.replace(/({[^{]{0,6}quot[^\|]{1,7}\s?\|[^}]*?)(ana|cata|hydro|para)(lyz)([^}]*?})/g, '$1$2xXx$3$4');
txt.value=txt.value.replace(/({[^{]{0,6}quot[^\|]{1,7}\s?\|[^}]*?)(ly)(zing)([^}]*?})/g, '$1$2xXx$3$4');
txt=txt.replace(/({[^{]{0,6}quot[^\|]{1,7}\s?\|[^}]*?)(ly)(zing)([^}]*?})/g, '$1$2xXx$3$4');
txt.value=txt.value.replace(/({[^{]{0,6}quot[^\|]{1,7}\s?\|[^}]*?)(di)(arrhea)([^}]*?})/g, '$1$2xXx$3$4');
txt=txt.replace(/({[^{]{0,6}quot[^\|]{1,7}\s?\|[^}]*?)(di)(arrhea)([^}]*?})/g, '$1$2xXx$3$4');
txt.value=txt.value.replace(/({[^{]{0,6}quot[^\|]{1,7}\s?\|[^}]*?)(de)(fense)([^}]*?})/g, '$1$2xXx$3$4');
txt=txt.replace(/({[^{]{0,6}quot[^\|]{1,7}\s?\|[^}]*?)(de)(fense)([^}]*?})/g, '$1$2xXx$3$4');
txt.value=txt.value.replace(/({[^{]{0,6}quot[^\|]{1,7}\s?\|[^}]*?)(of)(fense)([^}]*?})/g, '$1$2xXx$3$4');
txt=txt.replace(/({[^{]{0,6}quot[^\|]{1,7}\s?\|[^}]*?)(of)(fense)([^}]*?})/g, '$1$2xXx$3$4');
txt.value=txt.value.replace(/({[^{]{0,6}quot[^\|]{1,7}\s?\|[^}]*?)(fu)(ror)([^}]*?})/g, '$1$2xXx$3$4');
txt=txt.replace(/({[^{]{0,6}quot[^\|]{1,7}\s?\|[^}]*?)(fu)(ror)([^}]*?})/g, '$1$2xXx$3$4');
txt.value=txt.value.replace(/({[^{]{0,6}quot[^\|]{1,7}\s?\|[^}]*?)(gr)(ay)([^}]*?})/g, '$1$2xXx$3$4');
txt=txt.replace(/({[^{]{0,6}quot[^\|]{1,7}\s?\|[^}]*?)(gr)(ay)([^}]*?})/g, '$1$2xXx$3$4');
txt.value=txt.value.replace(/({[^{]{0,6}quot[^\|]{1,7}\s?\|[^}]*?)(je)(welry)([^}]*?})/g, '$1$2xXx$3$4');
txt=txt.replace(/({[^{]{0,6}quot[^\|]{1,7}\s?\|[^}]*?)(je)(welry)([^}]*?})/g, '$1$2xXx$3$4');
txt.value=txt.value.replace(/({[^{]{0,6}quot[^\|]{1,7}\s?\|[^}]*?)(ma)(neuver)([^}]*?})/g, '$1$2xXx$3$4');
txt=txt.replace(/({[^{]{0,6}quot[^\|]{1,7}\s?\|[^}]*?)(ma)(neuver)([^}]*?})/g, '$1$2xXx$3$4');
txt.value=txt.value.replace(/({[^{]{0,6}quot[^\|]{1,7}\s?\|[^}]*?)(pe)(diatric)([^}]*?})/g, '$1$2xXx$3$4');
txt=txt.replace(/({[^{]{0,6}quot[^\|]{1,7}\s?\|[^}]*?)(pe)(diatric)([^}]*?})/g, '$1$2xXx$3$4');
txt.value=txt.value.replace(/({[^{]{0,6}quot[^\|]{1,7}\s?\|[^}]*?)(pe)(dophil)([^}]*?})/g, '$1$2xXx$3$4');
txt=txt.replace(/({[^{]{0,6}quot[^\|]{1,7}\s?\|[^}]*?)(pe)(dophil)([^}]*?})/g, '$1$2xXx$3$4');
txt.value=txt.value.replace(/({[^{]{0,6}quot[^\|]{1,7}\s?\|[^}]*?)(sk)(eptic)([^}]*?})/g, '$1$2xXx$3$4');
txt=txt.replace(/({[^{]{0,6}quot[^\|]{1,7}\s?\|[^}]*?)(sk)(eptic)([^}]*?})/g, '$1$2xXx$3$4');
txt.value=txt.value.replace(/({[^{]{0,6}quot[^\|]{1,7}\s?\|[^}]*?)(va)(por)([^}]*?})/g, '$1$2xXx$3$4');
txt=txt.replace(/({[^{]{0,6}quot[^\|]{1,7}\s?\|[^}]*?)(va)(por)([^}]*?})/g, '$1$2xXx$3$4');
txt.value=txt.value.replace(/({[^{]{0,6}quot[^\|]{1,7}\s?\|[^}]*?)(on)(stage)([^}]*?})/g, '$1$2xXx$3$4');
txt=txt.replace(/({[^{]{0,6}quot[^\|]{1,7}\s?\|[^}]*?)(on)(stage)([^}]*?})/g, '$1$2xXx$3$4');
txt.value=txt.value.replace(/({[^{]{0,6}quot[^\|]{1,7}\s?\|[^}]*?)(break|clean|lock|pick)(up)([^}]*?})/g, '$1$2xXx$3$4');
txt=txt.replace(/({[^{]{0,6}quot[^\|]{1,7}\s?\|[^}]*?)(break|clean|lock|pick)(up)([^}]*?})/g, '$1$2xXx$3$4');
txt.value=txt.value.replace(/({[^{]{0,6}quot[^\|]{1,7}\s?\|[^}]*?)(he)(mo)([^}]*?})/g, '$1$2xXx$3$4');
txt=txt.replace(/({[^{]{0,6}quot[^\|]{1,7}\s?\|[^}]*?)(he)(mo)([^}]*?})/g, '$1$2xXx$3$4');
txt.value=txt.value.replace(/({[^{]{0,6}quot[^\|]{1,7}\s?\|[^}]*?)(or)(thopedic)([^}]*?})/g, '$1$2xXx$3$4');
txt=txt.replace(/({[^{]{0,6}quot[^\|]{1,7}\s?\|[^}]*?)(or)(thopedic)([^}]*?})/g, '$1$2xXx$3$4');
txt.value=txt.value.replace(/({[^{]{0,6}quot[^\|]{1,7}\s?\|[^}]*?)(ar)(cheo)([^}]*?})/g, '$1$2xXx$3$4');
txt=txt.replace(/({[^{]{0,6}quot[^\|]{1,7}\s?\|[^}]*?)(ar)(cheo)([^}]*?})/g, '$1$2xXx$3$4');
txt.value=txt.value.replace(/({[^{]{0,6}quot[^\|]{1,7}\s?\|[^}]*?)(pa)(leonto)([^}]*?})/g, '$1$2xXx$3$4');
txt=txt.replace(/({[^{]{0,6}quot[^\|]{1,7}\s?\|[^}]*?)(pa)(leonto)([^}]*?})/g, '$1$2xXx$3$4');
txt.value=txt.value.replace(/({[^{]{0,6}quot[^\|]{1,7}\s?\|[^}]*?)(en)(ology)([^}]*?})/g, '$1$2xXx$3$4');
txt=txt.replace(/({[^{]{0,6}quot[^\|]{1,7}\s?\|[^}]*?)(en)(ology)([^}]*?})/g, '$1$2xXx$3$4');
txt.value=txt.value.replace(/({[^{]{0,6}quot[^\|]{1,7}\s?\|[^}]*?)(es)(ophag)([^}]*?})/g, '$1$2xXx$3$4');
txt=txt.replace(/({[^{]{0,6}quot[^\|]{1,7}\s?\|[^}]*?)(es)(ophag)([^}]*?})/g, '$1$2xXx$3$4');
txt.value=txt.value.replace(/({[^{]{0,6}quot[^\|]{1,7}\s?\|[^}]*?)(es)(trogen)([^}]*?})/g, '$1$2xXx$3$4');
txt=txt.replace(/({[^{]{0,6}quot[^\|]{1,7}\s?\|[^}]*?)(es)(trogen)([^}]*?})/g, '$1$2xXx$3$4');
txt.value=txt.value.replace(/({[^{]{0,6}quot[^\|]{1,7}\s?\|[^}]*?)(es)(thetic)([^}]*?})/g, '$1$2xXx$3$4');
txt=txt.replace(/({[^{]{0,6}quot[^\|]{1,7}\s?\|[^}]*?)(es)(thetic)([^}]*?})/g, '$1$2xXx$3$4');
txt.value=txt.value.replace(/({[^{]{0,6}quot[^\|]{1,7}\s?\|[^}]*?)(ho)(meopath)([^}]*?})/g, '$1$2xXx$3$4');
txt=txt.replace(/({[^{]{0,6}quot[^\|]{1,7}\s?\|[^}]*?)(ho)(meopath)([^}]*?})/g, '$1$2xXx$3$4');
txt.value=txt.value.replace(/({[^{]{0,6}quot[^\|]{1,7}\s?\|[^}]*?)(me)(dieval)([^}]*?})/g, '$1$2xXx$3$4');
txt=txt.replace(/({[^{]{0,6}quot[^\|]{1,7}\s?\|[^}]*?)(me)(dieval)([^}]*?})/g, '$1$2xXx$3$4');
txt.value=txt.value.replace(/({[^{]{0,6}quot[^\|]{1,7}\s?\|[^}]*?)(ri)(gor)([^}]*?})/g, '$1$2xXx$3$4');
txt=txt.replace(/({[^{]{0,6}quot[^\|]{1,7}\s?\|[^}]*?)(ri)(gor)([^}]*?})/g, '$1$2xXx$3$4');
txt.value=txt.value.replace(/({[^{]{0,6}quot[^\|]{1,7}\s?\|[^}]*?)(an|leuk|septic|tox)(emi)([^}]*?})/g, '$1$2xXx$3$4');
txt=txt.replace(/({[^{]{0,6}quot[^\|]{1,7}\s?\|[^}]*?)(an|leuk|septic|tox)(emi)([^}]*?})/g, '$1$2xXx$3$4');
txt.value=txt.value.replace(/({[^{]{0,6}quot[^\|]{1,7}\s?\|[^}]*?)(su)(lfur)([^}]*?})/g, '$1$2xXx$3$4');
txt=txt.replace(/({[^{]{0,6}quot[^\|]{1,7}\s?\|[^}]*?)(su)(lfur)([^}]*?})/g, '$1$2xXx$3$4');
txt.value=txt.value.replace(/({[^{]{0,6}quot[^\|]{1,7}\s?\|[^}]*?)(lik|liv|rat|sal|siz|shak)(able)([^}]*?})/g, '$1$2xXx$3$4');
txt=txt.replace(/({[^{]{0,6}quot[^\|]{1,7}\s?\|[^}]*?)(lik|liv|rat|sal|siz|shak)(able)([^}]*?})/g, '$1$2xXx$3$4');
txt.value=txt.value.replace(/({[^{]{0,6}quot[^\|]{1,7}\s?\|[^}]*?)(clam|glam|harb|neighb|rum|savi?)(or)([^}]*?})/g, '$1$2xXx$3$4');
txt=txt.replace(/({[^{]{0,6}quot[^\|]{1,7}\s?\|[^}]*?)(clam|glam|harb|neighb|rum|savi?)(or)([^}]*?})/g, '$1$2xXx$3$4');
txt.value=txt.value.replace(/({[^{]{0,6}quot[^\|]{1,7}\s?\|[^}]*?)(behavi|col|fl?av|hon|hum|lab)(or)([^}]*?})/g, '$1$2xXx$3$4');
txt=txt.replace(/({[^{]{0,6}quot[^\|]{1,7}\s?\|[^}]*?)(behavi|col|fl?av|hon|hum|lab)(or)([^}]*?})/g, '$1$2xXx$3$4');
txt.value=txt.value.replace(/({[^{]{0,6}quot[^\|]{1,7}\s?\|[^}]*?)(mo)(ld)([^}]*?})/g, '$1$2xXx$3$4');
txt=txt.replace(/({[^{]{0,6}quot[^\|]{1,7}\s?\|[^}]*?)(mo)(ld)([^}]*?})/g, '$1$2xXx$3$4');
txt.value=txt.value.replace(/({[^{]{0,6}quot[^\|]{1,7}\s?\|[^}]*?)(calib|fib|goit|lust|mit|nit|reconnoit|sab|saltpet|spect|theat|tit)(er)([^}]*?})/g, '$1$2xXx$3$4');
txt=txt.replace(/({[^{]{0,6}quot[^\|]{1,7}\s?\|[^}]*?)(calib|fib|goit|lust|mit|nit|reconnoit|sab|saltpet|spect|theat|tit)(er)([^}]*?})/g, '$1$2xXx$3$4');
txt.value=txt.value.replace(/({[^{]{0,6}quot[^\|]{1,7}\s?\|[^}]*?)(cent|epicent|recent)(er)([^}]*?})/g, '$1$2xXx$3$4');
txt=txt.replace(/({[^{]{0,6}quot[^\|]{1,7}\s?\|[^}]*?)(cent|epicent|recent)(er)([^}]*?})/g, '$1$2xXx$3$4');
txt.value=txt.value.replace(/({[^{]{0,6}quot[^\|]{1,7}\s?\|[^}]*?)(centi|kilo|milli|\d\s)(meter)([^}]*?})/g, '$1$2xXx$3$4');
txt=txt.replace(/({[^{]{0,6}quot[^\|]{1,7}\s?\|[^}]*?)(centi|kilo|milli|\d\s)(meter)([^}]*?})/g, '$1$2xXx$3$4');
txt.value=txt.value.replace(/({[^{]{0,6}quot[^\|]{1,7}\s?\|[^}]*?)(centi|milli|deci|pico|hecto)(liter)([^}]*?})/g, '$1$2xXx$3$4');
txt=txt.replace(/({[^{]{0,6}quot[^\|]{1,7}\s?\|[^}]*?)(centi|milli|deci|pico|hecto)(liter)([^}]*?})/g, '$1$2xXx$3$4');
txt.value=txt.value.replace(/({[^{]{0,6}quot[^\|]{1,7}\s?\|[^}]*?)(dema|peda|mono|syna)(gog)([^}]*?})/g, '$1$2xXx$3$4');
txt=txt.replace(/({[^{]{0,6}quot[^\|]{1,7}\s?\|[^}]*?)(dema|peda|mono|syna)(gog)([^}]*?})/g, '$1$2xXx$3$4');
txt.value=txt.value.replace(/({[^{]{0,6}quot[^\|]{1,7}\s?\|[^}]*?)(ana|cata|dia|epi|homo|mono|pro)(log)([^}]*?})/g, '$1$2xXx$3$4');
txt=txt.replace(/({[^{]{0,6}quot[^\|]{1,7}\s?\|[^}]*?)(ana|cata|dia|epi|homo|mono|pro)(log)([^}]*?})/g, '$1$2xXx$3$4');
txt.value=txt.value.replace(/({[^{]{0,6}quot[^\|]{1,7}\s?\|[^}]*?)(iz)(e[drs]?|ations?|ing)([^}]*?})/g, '$1$2xXx$3$4');
txt=txt.replace(/({[^{]{0,6}quot[^\|]{1,7}\s?\|[^}]*?)(iz)(e[drs]?|ations?|ing)([^}]*?})/g, '$1$2xXx$3$4');
txt.value=txt.value.replace(/({[^{]{0,6}quot[^\|]{1,7}\s?\|[^}]*?)(el)(e[dr]|est|ing)([^}]*?})/g, '$1$2xXx$3$4');
txt=txt.replace(/({[^{]{0,6}quot[^\|]{1,7}\s?\|[^}]*?)(el)(e[dr]|est|ing)([^}]*?})/g, '$1$2xXx$3$4');
txt.value=txt.value.replace(/({[^{]{0,6}quot[^\|]{1,7}\s?\|[^}]*?)(counci|dia)(le[dr]|ling|lor)([^}]*?})/g, '$1$2xXx$3$4');
txt=txt.replace(/({[^{]{0,6}quot[^\|]{1,7}\s?\|[^}]*?)(counci|dia)(le[dr]|ling|lor)([^}]*?})/g, '$1$2xXx$3$4');
txt.value=txt.value.replace(/({[^{]{0,6}quot[^\|]{1,7}\s?\|[^}]*?)(app|enthr|riv|sign|tot)(ale[dr]|aling)([^}]*?})/g, '$1$2xXx$3$4');
txt=txt.replace(/({[^{]{0,6}quot[^\|]{1,7}\s?\|[^}]*?)(app|enthr|riv|sign|tot)(ale[dr]|aling)([^}]*?})/g, '$1$2xXx$3$4');
box.value = txt;

}
}


function Simple(){
function Simple(){
var txt=document.editform.wpTextbox1;
var box=document.editform.wpTextbox1;
var txt = box.value;


//protectwords()
//protectwords()


txt.value=txt.value.replace(/aluminum/g, 'aluminium');
txt=txt.replace(/aluminum/g, 'aluminium');
txt.value=txt.value.replace(/artifact/g, 'artefact');
txt=txt.replace(/artifact/g, 'artefact');
txt.value=txt.value.replace(/(ana|cata|hydro|para)lyz(e|ing)/g, '$1lys$2');
txt=txt.replace(/(ana|cata|hydro|para)lyz(e|ing)/g, '$1lys$2');
txt.value=txt.value.replace(/diarrhea/g, 'diarrhoea');
txt=txt.replace(/diarrhea/g, 'diarrhoea');
txt.value=txt.value.replace(/(de|of)fense/g, '$1fence');
txt=txt.replace(/(de|of)fense/g, '$1fence');
txt.value=txt.value.replace(/(\W)furor(\W)/g, '$1furore$2');
txt=txt.replace(/(\W)furor(\W)/g, '$1furore$2');
txt.value=txt.value.replace(/(light\s|dark\s|\s)gray/g, '$1grey');
txt=txt.replace(/(light\s|dark\s|\s)gray/g, '$1grey');
//txt.value=txt.value.replace(/judgment/g, 'judgement');
//txt=txt.replace(/judgment/g, 'judgement');
txt.value=txt.value.replace(/(\W)jewelry(\W)/g, '$1jewellery$2');
txt=txt.replace(/(\W)jewelry(\W)/g, '$1jewellery$2');
txt.value=txt.value.replace(/maneuver(ab|ed|ing)/g, 'manoeuvr$1');
txt=txt.replace(/maneuver(ab|ed|ing)/g, 'manoeuvr$1');
txt.value=txt.value.replace(/maneuver/g, 'manoeuvre');
txt=txt.replace(/maneuver/g, 'manoeuvre');
txt.value=txt.value.replace(/ped(iatric|ophil)/g, 'paed$1');
txt=txt.replace(/ped(iatric|ophil)/g, 'paed$1');
txt.value=txt.value.replace(/skeptic/g, 'sceptic');
txt=txt.replace(/skeptic/g, 'sceptic');
txt.value=txt.value.replace(/vapor(s?\W)/g, 'vapour$1');
txt=txt.replace(/vapor(s?\W)/g, 'vapour$1');


//composite words
//composite words
//txt.value=txt.value.replace(/onstage/g, 'on-stage');
//txt=txt.replace(/onstage/g, 'on-stage');
txt.value=txt.value.replace(/(break|lock|pick)up/g, '$1-up');
txt=txt.replace(/(break|lock|pick)up/g, '$1-up');


//latin words
//latin words
txt.value=txt.value.replace(/gyneco/g, 'gynaeco');
txt=txt.replace(/gyneco/g, 'gynaeco');
txt.value=txt.value.replace(/hemo(globin|ly|phil)/g, 'haemo$1');
txt=txt.replace(/hemo(globin|ly|phil)/g, 'haemo$1');
txt.value=txt.value.replace(/orthopedic/g, 'orthopaedic');
txt=txt.replace(/orthopedic/g, 'orthopaedic');
txt.value=txt.value.replace(/archeo/g, 'archaeo');
txt=txt.replace(/archeo/g, 'archaeo');
txt.value=txt.value.replace(/paleonto/g, 'palaeonto');
txt=txt.replace(/paleonto/g, 'palaeonto');
txt.value=txt.value.replace(/(\W)enology/g, '$1oenology');
txt=txt.replace(/(\W)enology/g, '$1oenology');
txt.value=txt.value.replace(/(\W)esophag/g, '$1oesophag');
txt=txt.replace(/(\W)esophag/g, '$1oesophag');
txt.value=txt.value.replace(/(\W)estrogen/g, '$1oestrogen');
txt=txt.replace(/(\W)estrogen/g, '$1oestrogen');
txt.value=txt.value.replace(/(\W)esthetic/g, '$1aesthetic');
txt=txt.replace(/(\W)esthetic/g, '$1aesthetic');
txt.value=txt.value.replace(/homeopath/g, 'homoeopath');
txt=txt.replace(/homeopath/g, 'homoeopath');
//txt.value=txt.value.replace(/medieval\b/g, 'mediaeval');
//txt=txt.replace(/medieval\b/g, 'mediaeval');
txt.value=txt.value.replace(/(\W)rigor(\W)/g, '$1rigour');
txt=txt.replace(/(\W)rigor(\W)/g, '$1rigour');
txt.value=txt.value.replace(/(an|leuk|septic|tox)emi(a|c)/g, '$1aemi$2');
txt=txt.replace(/(an|leuk|septic|tox)emi(a|c)/g, '$1aemi$2');


//'f' words
//'f' words
txt.value=txt.value.replace(/sulfur/g, 'sulphur');
txt=txt.replace(/sulfur/g, 'sulphur');


// non-redundant e
// non-redundant e
txt.value=txt.value.replace(/(lik|liv|rat|sal|siz|shak)(able)/g, '$1e$2');
txt=txt.replace(/(lik|liv|rat|sal|siz|shak)(able)/g, '$1e$2');


//'~our' words
//'~our' words
txt.value=txt.value.replace(/(clam|glam|harb|neighb|rum|savi?)or(ed|ful|ing|less|ly|s|)\b/g, '$1our$2');
txt=txt.replace(/(clam|glam|harb|neighb|rum|savi?)or(ed|ful|ing|less|ly|s|)\b/g, '$1our$2');
txt.value=txt.value.replace(/neighborhood/g, 'neighbourhood');
txt=txt.replace(/neighborhood/g, 'neighbourhood');
txt.value=txt.value.replace(/behavior(al|s?\W)/g, 'behaviour$1');
txt=txt.replace(/behavior(al|s?\W)/g, 'behaviour$1');
txt.value=txt.value.replace(/(fav|hon)or(abl[ey]|ed|ing|s|)\b/g, '$1our$2');
txt=txt.replace(/(fav|hon)or(abl[ey]|ed|ing|s|)\b/g, '$1our$2');
txt.value=txt.value.replace(/(\W)labor(ed|ing|s?\W)/g, '$1labour$2');
txt=txt.replace(/(\W)labor(ed|ing|s?\W)/g, '$1labour$2');
txt.value=txt.value.replace(/(col|flav|hum)or(ed|ful|fully|ings?|less|lessly|s\W)/g, '$1our$2');
txt=txt.replace(/(col|flav|hum)or(ed|ful|fully|ings?|less|lessly|s\W)/g, '$1our$2');


txt.value=txt.value.replace(/(\W)mold(ed|ing|s?\W)/g, '$1mould$2');
txt=txt.replace(/(\W)mold(ed|ing|s?\W)/g, '$1mould$2');


//'~re~' words
//'~re~' words
txt.value=txt.value.replace(/\b(calib|fib|goit|lust|mit|nit|reconnoit|sab|saltpet|spect|theat|tit)er/g, '$1re');
txt=txt.replace(/\b(calib|fib|goit|lust|mit|nit|reconnoit|sab|saltpet|spect|theat|tit)er/g, '$1re');
txt.value=txt.value.replace(/(cent|epicent|recent)er(ed|ing|s)/g, '$1r$2');
txt=txt.replace(/(cent|epicent|recent)er(ed|ing|s)/g, '$1r$2');
txt.value=txt.value.replace(/centers/g, 'centres');
txt=txt.replace(/centers/g, 'centres');
txt.value=txt.value.replace(/(centi|kilo|milli|-|\d\s)meter/g, '$1metre');
txt=txt.replace(/(centi|kilo|milli|-|\d\s)meter/g, '$1metre');
txt.value=txt.value.replace(/(centi|milli|deci|pico|hecto|\b)liter(s?\b)/g, '$1litre$2');
txt=txt.replace(/(centi|milli|deci|pico|hecto|\b)liter(s?\b)/g, '$1litre$2');
txt.value=txt.value.replace(/(dema|peda|mono|syna)gog(s?\W)/g, '$1gogue$2');
txt=txt.replace(/(dema|peda|mono|syna)gog(s?\W)/g, '$1gogue$2');
txt.value=txt.value.replace(/([^\\|\/|\-])(ana|cata|dia|epi|homo|mono|pro)log\b/g, '$1$2logue');
txt=txt.replace(/([^\\|\/|\-])(ana|cata|dia|epi|homo|mono|pro)log\b/g, '$1$2logue');
//txt.value=txt.value.replace(/(\W[a-z]{3,12}[^s])[^\b]iz(e[drs]?|ations?|ing)(\W)/g, '$1is$2$3');
//txt=txt.replace(/(\W[a-z]{3,12}[^s])[^\b]iz(e[drs]?|ations?|ing)(\W)/g, '$1is$2$3');
//txt.value=txt.value.replace(/(empha|synthe)siz(e|ing)/g, '$1sis$2');
//txt=txt.replace(/(empha|synthe)siz(e|ing)/g, '$1sis$2');


//'~l' words where the 'l' doubles as past and present participle
//'~l' words where the 'l' doubles as past and present participle
txt.value=txt.value.replace(/(bev|jew|lev|mod|rev|trav)el(e[dr]|ing)/g, '$1ell$2');
txt=txt.replace(/(bev|jew|lev|mod|rev|trav)el(e[dr]|ing)/g, '$1ell$2');
txt.value=txt.value.replace(/(\b[a-z]{2,8}[^egl ])el(e[dr]|est|ing)\b/g, '$1ell$2');
txt=txt.replace(/(\b[a-z]{2,8}[^egl ])el(e[dr]|est|ing)\b/g, '$1ell$2');
txt.value=txt.value.replace(/(counci|dia)l(e[dr]|ing|or)\b/gi, '$1ll$2');
txt=txt.replace(/(counci|dia)l(e[dr]|ing|or)\b/gi, '$1ll$2');
txt.value=txt.value.replace(/(app|enthr|riv|sign|tot)al(e[dr]|ing)/g, '$1all$2');
txt=txt.replace(/(app|enthr|riv|sign|tot)al(e[dr]|ing)/g, '$1all$2');
txt.value=txt.value.replace(/(\s[\w]*)ll(ful|ment)/g, '$1l$2');
txt=txt.replace(/(\s[\w]*)ll(ful|ment)/g, '$1l$2');


//reconvert special cases
//reconvert special cases
txt.value=txt.value.replace(/(nobelpr|pics)ise/g, '$1ize');
txt=txt.replace(/(nobelpr|pics)ise/g, '$1ize');


// unprotectwords()
// unprotectwords()
box.value = txt;

}
}
function OxEnglish() {
function OxEnglish() {
Line 301: Line 303:
}
}
function zwords(){
function zwords(){
var txt=document.editform.wpTextbox1;
var box=document.editform.wpTextbox1;
var txt = box.value;

txt.value=txt.value.replace(/(\W[a-z]{3,12}[^s ])iz(e[drs]?|ations?|ing)(\W)/g, '$1is$2$3');
txt.value=txt.value.replace(/(empha|synthe)siz(e|ing)/g, '$1sis$2');


txt=txt.replace(/(\W[a-z]{3,12}[^s ])iz(e[drs]?|ations?|ing)(\W)/g, '$1is$2$3');
txt=txt.replace(/(empha|synthe)siz(e|ing)/g, '$1sis$2');
box.value = txt;
}
}


function unprotectwords(){
function unprotectwords(){
var txt=document.editform.wpTextbox1;
var box=document.editform.wpTextbox1;
var txt = box.value;

txt.value=txt.value.replace(/(\w)xXx(\w)/g, '$1$2');


txt=txt.replace(/(\w)xXx(\w)/g, '$1$2');
box.value = txt;
}
}


function insert_EngvarB(){
function insert_EngvarB(){
var txt=document.editform.wpTextbox1;
var box=document.editform.wpTextbox1;
var txt = box.value;
// Add a template to the article identifying English variant
// Add a template to the article identifying English variant
if (txt.value.search(/{{EngvarB}}/gi) == -1)
if (txt.search(/{{EngvarB}}/gi) == -1)
{
{
txt.value='{{EngvarB}}\r\n'+txt.value;
box.value='{{EngvarB}}\r\n'+txt;
}
}
}
}


function insert_EngvarOx(){
function insert_EngvarOx(){
var txt=document.editform.wpTextbox1;
var box=document.editform.wpTextbox1;
var txt = box.value;
// Add a template to the article identifying English variant
// Add a template to the article identifying English variant
if (txt.value.search(/{{EngvarB}}/gi) == -1)
if (txt.search(/{{EngvarB}}/gi) == -1)
{
{
txt.value='{{EngvarOx}}\r\n'+txt.value;
box.value='{{EngvarOx}}\r\n'+txt;
}
}
}
}
Line 336: Line 342:


// Add a tag to the summary box
// Add a tag to the summary box
var txt=document.editform.wpSummary;
var form=document.editform.wpSummary;
var txt = form.value;

var summary = "per [[WP:ENGVAR|British English]]";
var summary = "per [[WP:ENGVAR|British English]]";
if (txt.value.indexOf(summary) == -1) {
if (txt.indexOf(summary) == -1) {
if (txt.value.match(/[^\*\/\s][^\/\s]?\s*$/)) {
if (txt.match(/[^\*\/\s][^\/\s]?\s*$/)) {
txt.value += " | ";
txt += " | ";
}
}
txt.value += summary;
txt += summary;
}
}
// document.forms.editform.wpMinoredit.checked = true;
// document.forms.editform.wpMinoredit.checked = true;
form.value=txt;
document.editform.wpDiff.click();
document.editform.wpDiff.click();
}
}

Revision as of 23:03, 1 July 2010

// This script converts American English spellings into British spellings. // PLEASE READ THE DOCUMENTATION at User:Ohconfucius/EngvarB (click on the link above) before using.

// Feedback and constructive criticism are welcome... however, please don't tell me something I know already // As I am a scripting newbie, any technical advice on the 'hows and the wherefores' are especially welcome.


function protectwords(){

var box=document.editform.wpTextbox1;
var txt = box.value;

//txt=txt.replace(/(\[(?:file|image):[^\.]{0,20})(?:xx)([^\.]{0,20}\.)/g, '$1$2$3');

unprotectwords();
txt=txt.replace(/(<.+?>[^<]+?)(al)(uminum)([^<]+?<\/.+?>)/g, '$1$2xXx$3$4');
txt=txt.replace(/(<.+?>[^<]+?)(ar)(tifact)([^<]+?<\/.+?>)/g, '$1$2xXx$3$4');
txt=txt.replace(/(<.+?>[^<]+?)(ana|cata|hydro|para)(lyz)([^<]+?<\/.+?>)/g, '$1$2xXx$3$4');
txt=txt.replace(/(<.+?>[^<]+?)(ly)(zing)([^<]+?<\/.+?>)/g, '$1$2xXx$3$4');
txt=txt.replace(/(<.+?>[^<]+?)(di)(arrhea)([^<]+?<\/.+?>)/g, '$1$2xXx$3$4');
txt=txt.replace(/(<.+?>[^<]+?)(de)(fense)([^<]+?<\/.+?>)/g, '$1$2xXx$3$4');
txt=txt.replace(/(<.+?>[^<]+?)(of)(fense)([^<]+?<\/.+?>)/g, '$1$2xXx$3$4');
txt=txt.replace(/(<.+?>[^<]+?)(fu)(ror)([^<]+?<\/.+?>)/g, '$1$2xXx$3$4');
txt=txt.replace(/(<.+?>[^<]+?)(gr)(ay)([^<]+?<\/.+?>)/g, '$1$2xXx$3$4');
txt=txt.replace(/(<.+?>[^<]+?)(je)(welry)([^<]+?<\/.+?>)/g, '$1$2xXx$3$4');
txt=txt.replace(/(<.+?>[^<]+?)(ma)(neuver)([^<]+?<\/.+?>)/g, '$1$2xXx$3$4');
txt=txt.replace(/(<.+?>[^<]+?)(pe)(diatric)([^<]+?<\/.+?>)/g, '$1$2xXx$3$4');
txt=txt.replace(/(<.+?>[^<]+?)(pe)(dophil)([^<]+?<\/.+?>)/g, '$1$2xXx$3$4');
txt=txt.replace(/(<.+?>[^<]+?)(sk)(eptic)([^<]+?<\/.+?>)/g, '$1$2xXx$3$4');
txt=txt.replace(/(<.+?>[^<]+?)(va)(por)([^<]+?<\/.+?>)/g, '$1$2xXx$3$4');
txt=txt.replace(/(<.+?>[^<]+?)(on)(stage)([^<]+?<\/.+?>)/g, '$1$2xXx$3$4');
txt=txt.replace(/(<.+?>[^<]+?)(break|clean|lock|pick)(up)([^<]+?<\/.+?>)/g, '$1$2xXx$3$4');
txt=txt.replace(/(<.+?>[^<]+?)(he)(mo)([^<]+?<\/.+?>)/g, '$1$2xXx$3$4');
txt=txt.replace(/(<.+?>[^<]+?)(or)(thopedic)([^<]+?<\/.+?>)/g, '$1$2xXx$3$4');
txt=txt.replace(/(<.+?>[^<]+?)(ar)(cheo)([^<]+?<\/.+?>)/g, '$1$2xXx$3$4');
txt=txt.replace(/(<.+?>[^<]+?)(pa)(leonto)([^<]+?<\/.+?>)/g, '$1$2xXx$3$4');
txt=txt.replace(/(<.+?>[^<]+?)(en)(ology)([^<]+?<\/.+?>)/g, '$1$2xXx$3$4');
txt=txt.replace(/(<.+?>[^<]+?)(es)(ophag)([^<]+?<\/.+?>)/g, '$1$2xXx$3$4');
txt=txt.replace(/(<.+?>[^<]+?)(es)(trogen)([^<]+?<\/.+?>)/g, '$1$2xXx$3$4');
txt=txt.replace(/(<.+?>[^<]+?)(es)(thetic)([^<]+?<\/.+?>)/g, '$1$2xXx$3$4');
txt=txt.replace(/(<.+?>[^<]+?)(ho)(meopath)([^<]+?<\/.+?>)/g, '$1$2xXx$3$4');
txt=txt.replace(/(<.+?>[^<]+?)(me)(dieval)([^<]+?<\/.+?>)/g, '$1$2xXx$3$4');
txt=txt.replace(/(<.+?>[^<]+?)(ri)(gor)([^<]+?<\/.+?>)/g, '$1$2xXx$3$4');
txt=txt.replace(/(<.+?>[^<]+?)(an|leuk|septic|tox)(emi)([^<]+?<\/.+?>)/g, '$1$2xXx$3$4');
txt=txt.replace(/(<.+?>[^<]+?)(su)(lfur)([^<]+?<\/.+?>)/g, '$1$2xXx$3$4');
txt=txt.replace(/(<.+?>[^<]+?)(lik|liv|rat|sal|siz|shak)(able)([^<]+?<\/.+?>)/g, '$1$2xXx$3$4');
txt=txt.replace(/(<.+?>[^<]+?)(clam|glam|harb|neighb|rum|savi?)(or)([^<]+?<\/.+?>)/g, '$1$2xXx$3$4');
txt=txt.replace(/(<.+?>[^<]+?)(behavi|col|fl?av|hon|hum|lab)(or)([^<]+?<\/.+?>)/g, '$1$2xXx$3$4');
txt=txt.replace(/(<.+?>[^<]+?)(mo)(ld)([^<]+?<\/.+?>)/g, '$1$2xXx$3$4');
txt=txt.replace(/(<.+?>[^<]+?)(calib|fib|goit|lust|mit|nit|reconnoit|sab|saltpet|spect|theat|tit)(er)([^<]+?<\/.+?>)/g, '$1$2xXx$3$4');
txt=txt.replace(/(<.+?>[^<]+?)(cent|epicent|recent)(er)([^<]+?<\/.+?>)/g, '$1$2xXx$3$4');
txt=txt.replace(/(<.+?>[^<]+?)(centi|kilo|milli|\d\s)(meter)([^<]+?<\/.+?>)/g, '$1$2xXx$3$4');
txt=txt.replace(/(<.+?>[^<]+?)(centi|milli|deci|pico|hecto)(liter)([^<]+?<\/.+?>)/g, '$1$2xXx$3$4');
txt=txt.replace(/(<.+?>[^<]+?)(dema|peda|mono|syna)(gog)([^<]+?<\/.+?>)/g, '$1$2xXx$3$4');
txt=txt.replace(/(<.+?>[^<]+?)(ana|cata|dia|epi|homo|mono|pro)(log)([^<]+?<\/.+?>)/g, '$1$2xXx$3$4');
txt=txt.replace(/(<.+?>[^<]+?)(iz)(e[drs]?|ations?|ing)([^<]+?<\/.+?>)/g, '$1$2xXx$3$4');
txt=txt.replace(/(<.+?>[^<]+?)(el)(e[dr]|est|ing)([^<]+?<\/.+?>)/g, '$1$2xXx$3$4');
txt=txt.replace(/(<.+?>[^<]+?)(counci|dia)(le[dr]|ling|lor)([^<]+?<\/.+?>)/g, '$1$2xXx$3$4');
txt=txt.replace(/(<.+?>[^<]+?)(app|enthr|riv|sign|tot)(ale[dr]|aling)([^<]+?<\/.+?>)/g, '$1$2xXx$3$4');

txt=txt.replace(/(\[Category:[^\]]*?)(al)(uminum)([^\]]*?\])/g, '$1$2xXx$3$4'); txt=txt.replace(/(\[Category:[^\]]*?)(ar)(tifact)([^\]]*?\])/g, '$1$2xXx$3$4'); txt=txt.replace(/(\[Category:[^\]]*?)(ana|cata|hydro|para)(lyz)([^\]]*?\])/g, '$1$2xXx$3$4'); txt=txt.replace(/(\[Category:[^\]]*?)(ly)(zing)([^\]]*?\])/g, '$1$2xXx$3$4'); //txt=txt.replace(/(\[Category:[^\]]*?)(di)(arrhea)([^\]]*?\])/g, '$1$2xXx$3$4'); //txt=txt.replace(/(\[Category:[^\]]*?)(de)(fense)([^\]]*?\])/g, '$1$2xXx$3$4'); //txt=txt.replace(/(\[Category:[^\]]*?)(of)(fense)([^\]]*?\])/g, '$1$2xXx$3$4'); //txt=txt.replace(/(\[Category:[^\]]*?)(fu)(ror)([^\]]*?\])/g, '$1$2xXx$3$4'); txt=txt.replace(/(\[Category:[^\]]*?)(gr)(ay)([^\]]*?\])/g, '$1$2xXx$3$4'); txt=txt.replace(/(\[Category:[^\]]*?)(je)(welry)([^\]]*?\])/g, '$1$2xXx$3$4'); //txt=txt.replace(/(\[Category:[^\]]*?)(ma)(neuver)([^\]]*?\])/g, '$1$2xXx$3$4'); txt=txt.replace(/(\[Category:[^\]]*?)(pe)(diatric)([^\]]*?\])/g, '$1$2xXx$3$4'); txt=txt.replace(/(\[Category:[^\]]*?)(pe)(dophil)([^\]]*?\])/g, '$1$2xXx$3$4'); txt=txt.replace(/(\[Category:[^\]]*?)(sk)(eptic)([^\]]*?\])/g, '$1$2xXx$3$4'); //txt=txt.replace(/(\[Category:[^\]]*?)(va)(por)([^\]]*?\])/g, '$1$2xXx$3$4'); //txt=txt.replace(/(\[Category:[^\]]*?)(on)(stage)([^\]]*?\])/g, '$1$2xXx$3$4'); //txt=txt.replace(/(\[Category:[^\]]*?)(break|clean|lock|pick)(up)([^\]]*?\])/g, '$1$2xXx$3$4'); txt=txt.replace(/(\[Category:[^\]]*?)(he)(mo)([^\]]*?\])/g, '$1$2xXx$3$4'); txt=txt.replace(/(\[Category:[^\]]*?)(or)(thopedic)([^\]]*?\])/g, '$1$2xXx$3$4'); txt=txt.replace(/(\[Category:[^\]]*?)(ar)(cheo)([^\]]*?\])/g, '$1$2xXx$3$4'); txt=txt.replace(/(\[Category:[^\]]*?)(pa)(leonto)([^\]]*?\])/g, '$1$2xXx$3$4'); txt=txt.replace(/(\[Category:[^\]]*?)(en)(ology)([^\]]*?\])/g, '$1$2xXx$3$4'); //txt=txt.replace(/(\[Category:[^\]]*?)(es)(ophag)([^\]]*?\])/g, '$1$2xXx$3$4'); //txt=txt.replace(/(\[Category:[^\]]*?)(es)(trogen)([^\]]*?\])/g, '$1$2xXx$3$4'); txt=txt.replace(/(\[Category:[^\]]*?)(es)(thetic)([^\]]*?\])/g, '$1$2xXx$3$4'); txt=txt.replace(/(\[Category:[^\]]*?)(ho)(meopath)([^\]]*?\])/g, '$1$2xXx$3$4'); txt=txt.replace(/(\[Category:[^\]]*?)(me)(dieval)([^\]]*?\])/g, '$1$2xXx$3$4'); //txt=txt.replace(/(\[Category:[^\]]*?)(ri)(gor)([^\]]*?\])/g, '$1$2xXx$3$4'); txt=txt.replace(/(\[Category:[^\]]*?)(an|leuk|septic|tox)(emi)([^\]]*?\])/g, '$1$2xXx$3$4'); txt=txt.replace(/(\[Category:[^\]]*?)(su)(lfur)([^\]]*?\])/g, '$1$2xXx$3$4'); //txt=txt.replace(/(\[Category:[^\]]*?)(lik|liv|rat|sal|siz|shak)(able)([^\]]*?\])/g, '$1$2xXx$3$4'); txt=txt.replace(/(\[Category:[^\]]*?)(clam|glam|harb|neighb|rum|savi?)(or)([^\]]*?\])/g, '$1$2xXx$3$4'); txt=txt.replace(/(\[Category:[^\]]*?)(behavi|col|fl?av|hon|hum|lab)(or)([^\]]*?\])/g, '$1$2xXx$3$4'); txt=txt.replace(/(\[Category:[^\]]*?)(mo)(ld)([^\]]*?\])/g, '$1$2xXx$3$4'); //txt=txt.replace(/(\[Category:[^\]]*?)(calib|fib|goit|lust|mit|nit|reconnoit|sab|saltpet|spect|theat|tit)(er)([^\]]*?\])/g, '$1$2xXx$3$4'); txt=txt.replace(/(\[Category:[^\]]*?)(cent|epicent|recent)(er)([^\]]*?\])/g, '$1$2xXx$3$4'); //txt=txt.replace(/(\[Category:[^\]]*?)(centi|kilo|milli|\d\s)(meter)([^\]]*?\])/g, '$1$2xXx$3$4'); //txt=txt.replace(/(\[Category:[^\]]*?)(centi|milli|deci|pico|hecto)(liter)([^\]]*?\])/g, '$1$2xXx$3$4'); txt=txt.replace(/(\[Category:[^\]]*?)(dema|peda|mono|syna)(gog)([^\]]*?\])/g, '$1$2xXx$3$4'); txt=txt.replace(/(\[Category:[^\]]*?)(ana|cata|dia|epi|homo|mono|pro)(log)([^\]]*?\])/g, '$1$2xXx$3$4'); txt=txt.replace(/(\[Category:[^\]]*?)(iz)(e[drs]?|ations?|ing)([^\]]*?\])/g, '$1$2xXx$3$4'); txt=txt.replace(/(\[Category:[^\]]*?)(el)(e[dr]|est|ing)([^\]]*?\])/g, '$1$2xXx$3$4'); txt=txt.replace(/(\[Category:[^\]]*?)(counci|dia)(le[dr]|ling|lor)([^\]]*?\])/g, '$1$2xXx$3$4'); //txt=txt.replace(/(\[Category:[^\]]*?)(app|enthr|riv|sign|tot)(ale[dr]|aling)([^\]]*?\])/g, '$1$2xXx$3$4');

txt=txt.replace(/(\[(?:file|image):[^\.]{0,20})(al)(uminum)([^\.]{0,20}\.)/g, '$1$2xXx$3$4'); txt=txt.replace(/(\[(?:file|image):[^\.]{0,20})(ar)(tifact)([^\.]{0,20}\.)/g, '$1$2xXx$3$4'); txt=txt.replace(/(\[(?:file|image):[^\.]{0,20})(ana|cata|hydro|para)(lyz)([^\.]{0,20}\.)/g, '$1$2xXx$3$4'); txt=txt.replace(/(\[(?:file|image):[^\.]{0,20})(ly)(zing)([^\.]{0,20}\.)/g, '$1$2xXx$3$4'); txt=txt.replace(/(\[(?:file|image):[^\.]{0,20})(di)(arrhea)([^\.]{0,20}\.)/g, '$1$2xXx$3$4'); txt=txt.replace(/(\[(?:file|image):[^\.]{0,20})(de)(fense)([^\.]{0,20}\.)/g, '$1$2xXx$3$4'); txt=txt.replace(/(\[(?:file|image):[^\.]{0,20})(of)(fense)([^\.]{0,20}\.)/g, '$1$2xXx$3$4'); txt=txt.replace(/(\[(?:file|image):[^\.]{0,20})(fu)(ror)([^\.]{0,20}\.)/g, '$1$2xXx$3$4'); txt=txt.replace(/(\[(?:file|image):[^\.]{0,20})(gr)(ay)([^\.]{0,20}\.)/g, '$1$2xXx$3$4'); txt=txt.replace(/(\[(?:file|image):[^\.]{0,20})(je)(welry)([^\.]{0,20}\.)/g, '$1$2xXx$3$4'); txt=txt.replace(/(\[(?:file|image):[^\.]{0,20})(ma)(neuver)([^\.]{0,20}\.)/g, '$1$2xXx$3$4'); txt=txt.replace(/(\[(?:file|image):[^\.]{0,20})(pe)(diatric)([^\.]{0,20}\.)/g, '$1$2xXx$3$4'); txt=txt.replace(/(\[(?:file|image):[^\.]{0,20})(pe)(dophil)([^\.]{0,20}\.)/g, '$1$2xXx$3$4'); txt=txt.replace(/(\[(?:file|image):[^\.]{0,20})(sk)(eptic)([^\.]{0,20}\.)/g, '$1$2xXx$3$4'); txt=txt.replace(/(\[(?:file|image):[^\.]{0,20})(va)(por)([^\.]{0,20}\.)/g, '$1$2xXx$3$4'); txt=txt.replace(/(\[(?:file|image):[^\.]{0,20})(on)(stage)([^\.]{0,20}\.)/g, '$1$2xXx$3$4'); txt=txt.replace(/(\[(?:file|image):[^\.]{0,20})(break|clean|lock|pick)(up)([^\.]{0,20}\.)/g, '$1$2xXx$3$4'); txt=txt.replace(/(\[(?:file|image):[^\.]{0,20})(he)(mo)([^\.]{0,20}\.)/g, '$1$2xXx$3$4'); txt=txt.replace(/(\[(?:file|image):[^\.]{0,20})(or)(thopedic)([^\.]{0,20}\.)/g, '$1$2xXx$3$4'); txt=txt.replace(/(\[(?:file|image):[^\.]{0,20})(ar)(cheo)([^\.]{0,20}\.)/g, '$1$2xXx$3$4'); txt=txt.replace(/(\[(?:file|image):[^\.]{0,20})(pa)(leonto)([^\.]{0,20}\.)/g, '$1$2xXx$3$4'); txt=txt.replace(/(\[(?:file|image):[^\.]{0,20})(en)(ology)([^\.]{0,20}\.)/g, '$1$2xXx$3$4'); txt=txt.replace(/(\[(?:file|image):[^\.]{0,20})(es)(ophag)([^\.]{0,20}\.)/g, '$1$2xXx$3$4'); txt=txt.replace(/(\[(?:file|image):[^\.]{0,20})(es)(trogen)([^\.]{0,20}\.)/g, '$1$2xXx$3$4'); txt=txt.replace(/(\[(?:file|image):[^\.]{0,20})(es)(thetic)([^\.]{0,20}\.)/g, '$1$2xXx$3$4'); txt=txt.replace(/(\[(?:file|image):[^\.]{0,20})(ho)(meopath)([^\.]{0,20}\.)/g, '$1$2xXx$3$4'); txt=txt.replace(/(\[(?:file|image):[^\.]{0,20})(me)(dieval)([^\.]{0,20}\.)/g, '$1$2xXx$3$4'); txt=txt.replace(/(\[(?:file|image):[^\.]{0,20})(ri)(gor)([^\.]{0,20}\.)/g, '$1$2xXx$3$4'); txt=txt.replace(/(\[(?:file|image):[^\.]{0,20})(an|leuk|septic|tox)(emi)([^\.]{0,20}\.)/g, '$1$2xXx$3$4'); txt=txt.replace(/(\[(?:file|image):[^\.]{0,20})(su)(lfur)([^\.]{0,20}\.)/g, '$1$2xXx$3$4'); txt=txt.replace(/(\[(?:file|image):[^\.]{0,20})(lik|liv|rat|sal|siz|shak)(able)([^\.]{0,20}\.)/g, '$1$2xXx$3$4'); txt=txt.replace(/(\[(?:file|image):[^\.]{0,20})(clam|glam|harb|neighb|rum|savi?)(or)([^\.]{0,20}\.)/g, '$1$2xXx$3$4'); txt=txt.replace(/(\[(?:file|image):[^\.]{0,20})(behavi|col|fl?av|hon|hum|lab)(or)([^\.]{0,20}\.)/g, '$1$2xXx$3$4'); txt=txt.replace(/(\[(?:file|image):[^\.]{0,20})(mo)(ld)([^\.]{0,20}\.)/g, '$1$2xXx$3$4'); txt=txt.replace(/(\[(?:file|image):[^\.]{0,20})(calib|fib|goit|lust|mit|nit|reconnoit|sab|saltpet|spect|theat|tit)(er)([^\.]{0,20}\.)/g, '$1$2xXx$3$4'); txt=txt.replace(/(\[(?:file|image):[^\.]{0,20})(cent|epicent|recent)(er)([^\.]{0,20}\.)/g, '$1$2xXx$3$4'); txt=txt.replace(/(\[(?:file|image):[^\.]{0,20})(centi|kilo|milli|\d\s)(meter)([^\.]{0,20}\.)/g, '$1$2xXx$3$4'); txt=txt.replace(/(\[(?:file|image):[^\.]{0,20})(centi|milli|deci|pico|hecto)(liter)([^\.]{0,20}\.)/g, '$1$2xXx$3$4'); txt=txt.replace(/(\[(?:file|image):[^\.]{0,20})(dema|peda|mono|syna)(gog)([^\.]{0,20}\.)/g, '$1$2xXx$3$4'); txt=txt.replace(/(\[(?:file|image):[^\.]{0,20})(ana|cata|dia|epi|homo|mono|pro)(log)([^\.]{0,20}\.)/g, '$1$2xXx$3$4'); txt=txt.replace(/(\[(?:file|image):[^\.]{0,20})(iz)(e[drs]?|ations?|ing)([^\.]{0,20}\.)/g, '$1$2xXx$3$4'); txt=txt.replace(/(\[(?:file|image):[^\.]{0,20})(bev|jew|lev|mod|rev|trav)(el)([^\.]{0,20}\.)/g, '$1$2xXx$3$4'); txt=txt.replace(/(\[(?:file|image):[^\.]{0,20})([a-z]{2,8}[^egl\b])(el)([^\.]{0,20}\.)/g, '$1$2xXx$3$4'); txt=txt.replace(/(\[(?:file|image):[^\.]{0,20})(counci|dia)(le[dr]|ling|lor)([^\.]{0,20}\.)/g, '$1$2xXx$3$4'); txt=txt.replace(/(\[(?:file|image):[^\.]{0,20})(app|enthr|riv|sign|tot)(ale[dr]|aling)([^\.]{0,20}\.)/g, '$1$2xXx$3$4');

//protection for quotations in templates txt=txt.replace(/({[^{]{0,6}quot[^\|]{1,7}\s?\|[^}]*?)(al)(uminum)([^}]*?})/g, '$1$2xXx$3$4'); txt=txt.replace(/({[^{]{0,6}quot[^\|]{1,7}\s?\|[^}]*?)(ar)(tifact)([^}]*?})/g, '$1$2xXx$3$4'); txt=txt.replace(/({[^{]{0,6}quot[^\|]{1,7}\s?\|[^}]*?)(ana|cata|hydro|para)(lyz)([^}]*?})/g, '$1$2xXx$3$4'); txt=txt.replace(/({[^{]{0,6}quot[^\|]{1,7}\s?\|[^}]*?)(ly)(zing)([^}]*?})/g, '$1$2xXx$3$4'); txt=txt.replace(/({[^{]{0,6}quot[^\|]{1,7}\s?\|[^}]*?)(di)(arrhea)([^}]*?})/g, '$1$2xXx$3$4'); txt=txt.replace(/({[^{]{0,6}quot[^\|]{1,7}\s?\|[^}]*?)(de)(fense)([^}]*?})/g, '$1$2xXx$3$4'); txt=txt.replace(/({[^{]{0,6}quot[^\|]{1,7}\s?\|[^}]*?)(of)(fense)([^}]*?})/g, '$1$2xXx$3$4'); txt=txt.replace(/({[^{]{0,6}quot[^\|]{1,7}\s?\|[^}]*?)(fu)(ror)([^}]*?})/g, '$1$2xXx$3$4'); txt=txt.replace(/({[^{]{0,6}quot[^\|]{1,7}\s?\|[^}]*?)(gr)(ay)([^}]*?})/g, '$1$2xXx$3$4'); txt=txt.replace(/({[^{]{0,6}quot[^\|]{1,7}\s?\|[^}]*?)(je)(welry)([^}]*?})/g, '$1$2xXx$3$4'); txt=txt.replace(/({[^{]{0,6}quot[^\|]{1,7}\s?\|[^}]*?)(ma)(neuver)([^}]*?})/g, '$1$2xXx$3$4'); txt=txt.replace(/({[^{]{0,6}quot[^\|]{1,7}\s?\|[^}]*?)(pe)(diatric)([^}]*?})/g, '$1$2xXx$3$4'); txt=txt.replace(/({[^{]{0,6}quot[^\|]{1,7}\s?\|[^}]*?)(pe)(dophil)([^}]*?})/g, '$1$2xXx$3$4'); txt=txt.replace(/({[^{]{0,6}quot[^\|]{1,7}\s?\|[^}]*?)(sk)(eptic)([^}]*?})/g, '$1$2xXx$3$4'); txt=txt.replace(/({[^{]{0,6}quot[^\|]{1,7}\s?\|[^}]*?)(va)(por)([^}]*?})/g, '$1$2xXx$3$4'); txt=txt.replace(/({[^{]{0,6}quot[^\|]{1,7}\s?\|[^}]*?)(on)(stage)([^}]*?})/g, '$1$2xXx$3$4'); txt=txt.replace(/({[^{]{0,6}quot[^\|]{1,7}\s?\|[^}]*?)(break|clean|lock|pick)(up)([^}]*?})/g, '$1$2xXx$3$4'); txt=txt.replace(/({[^{]{0,6}quot[^\|]{1,7}\s?\|[^}]*?)(he)(mo)([^}]*?})/g, '$1$2xXx$3$4'); txt=txt.replace(/({[^{]{0,6}quot[^\|]{1,7}\s?\|[^}]*?)(or)(thopedic)([^}]*?})/g, '$1$2xXx$3$4'); txt=txt.replace(/({[^{]{0,6}quot[^\|]{1,7}\s?\|[^}]*?)(ar)(cheo)([^}]*?})/g, '$1$2xXx$3$4'); txt=txt.replace(/({[^{]{0,6}quot[^\|]{1,7}\s?\|[^}]*?)(pa)(leonto)([^}]*?})/g, '$1$2xXx$3$4'); txt=txt.replace(/({[^{]{0,6}quot[^\|]{1,7}\s?\|[^}]*?)(en)(ology)([^}]*?})/g, '$1$2xXx$3$4'); txt=txt.replace(/({[^{]{0,6}quot[^\|]{1,7}\s?\|[^}]*?)(es)(ophag)([^}]*?})/g, '$1$2xXx$3$4'); txt=txt.replace(/({[^{]{0,6}quot[^\|]{1,7}\s?\|[^}]*?)(es)(trogen)([^}]*?})/g, '$1$2xXx$3$4'); txt=txt.replace(/({[^{]{0,6}quot[^\|]{1,7}\s?\|[^}]*?)(es)(thetic)([^}]*?})/g, '$1$2xXx$3$4'); txt=txt.replace(/({[^{]{0,6}quot[^\|]{1,7}\s?\|[^}]*?)(ho)(meopath)([^}]*?})/g, '$1$2xXx$3$4'); txt=txt.replace(/({[^{]{0,6}quot[^\|]{1,7}\s?\|[^}]*?)(me)(dieval)([^}]*?})/g, '$1$2xXx$3$4'); txt=txt.replace(/({[^{]{0,6}quot[^\|]{1,7}\s?\|[^}]*?)(ri)(gor)([^}]*?})/g, '$1$2xXx$3$4'); txt=txt.replace(/({[^{]{0,6}quot[^\|]{1,7}\s?\|[^}]*?)(an|leuk|septic|tox)(emi)([^}]*?})/g, '$1$2xXx$3$4'); txt=txt.replace(/({[^{]{0,6}quot[^\|]{1,7}\s?\|[^}]*?)(su)(lfur)([^}]*?})/g, '$1$2xXx$3$4'); txt=txt.replace(/({[^{]{0,6}quot[^\|]{1,7}\s?\|[^}]*?)(lik|liv|rat|sal|siz|shak)(able)([^}]*?})/g, '$1$2xXx$3$4'); txt=txt.replace(/({[^{]{0,6}quot[^\|]{1,7}\s?\|[^}]*?)(clam|glam|harb|neighb|rum|savi?)(or)([^}]*?})/g, '$1$2xXx$3$4'); txt=txt.replace(/({[^{]{0,6}quot[^\|]{1,7}\s?\|[^}]*?)(behavi|col|fl?av|hon|hum|lab)(or)([^}]*?})/g, '$1$2xXx$3$4'); txt=txt.replace(/({[^{]{0,6}quot[^\|]{1,7}\s?\|[^}]*?)(mo)(ld)([^}]*?})/g, '$1$2xXx$3$4'); txt=txt.replace(/({[^{]{0,6}quot[^\|]{1,7}\s?\|[^}]*?)(calib|fib|goit|lust|mit|nit|reconnoit|sab|saltpet|spect|theat|tit)(er)([^}]*?})/g, '$1$2xXx$3$4'); txt=txt.replace(/({[^{]{0,6}quot[^\|]{1,7}\s?\|[^}]*?)(cent|epicent|recent)(er)([^}]*?})/g, '$1$2xXx$3$4'); txt=txt.replace(/({[^{]{0,6}quot[^\|]{1,7}\s?\|[^}]*?)(centi|kilo|milli|\d\s)(meter)([^}]*?})/g, '$1$2xXx$3$4'); txt=txt.replace(/({[^{]{0,6}quot[^\|]{1,7}\s?\|[^}]*?)(centi|milli|deci|pico|hecto)(liter)([^}]*?})/g, '$1$2xXx$3$4'); txt=txt.replace(/({[^{]{0,6}quot[^\|]{1,7}\s?\|[^}]*?)(dema|peda|mono|syna)(gog)([^}]*?})/g, '$1$2xXx$3$4'); txt=txt.replace(/({[^{]{0,6}quot[^\|]{1,7}\s?\|[^}]*?)(ana|cata|dia|epi|homo|mono|pro)(log)([^}]*?})/g, '$1$2xXx$3$4'); txt=txt.replace(/({[^{]{0,6}quot[^\|]{1,7}\s?\|[^}]*?)(iz)(e[drs]?|ations?|ing)([^}]*?})/g, '$1$2xXx$3$4'); txt=txt.replace(/({[^{]{0,6}quot[^\|]{1,7}\s?\|[^}]*?)(el)(e[dr]|est|ing)([^}]*?})/g, '$1$2xXx$3$4'); txt=txt.replace(/({[^{]{0,6}quot[^\|]{1,7}\s?\|[^}]*?)(counci|dia)(le[dr]|ling|lor)([^}]*?})/g, '$1$2xXx$3$4'); txt=txt.replace(/({[^{]{0,6}quot[^\|]{1,7}\s?\|[^}]*?)(app|enthr|riv|sign|tot)(ale[dr]|aling)([^}]*?})/g, '$1$2xXx$3$4'); box.value = txt; }

function Simple(){

var box=document.editform.wpTextbox1;
var txt = box.value;

//protectwords()

txt=txt.replace(/aluminum/g, 'aluminium'); txt=txt.replace(/artifact/g, 'artefact'); txt=txt.replace(/(ana|cata|hydro|para)lyz(e|ing)/g, '$1lys$2'); txt=txt.replace(/diarrhea/g, 'diarrhoea'); txt=txt.replace(/(de|of)fense/g, '$1fence'); txt=txt.replace(/(\W)furor(\W)/g, '$1furore$2'); txt=txt.replace(/(light\s|dark\s|\s)gray/g, '$1grey'); //txt=txt.replace(/judgment/g, 'judgement'); txt=txt.replace(/(\W)jewelry(\W)/g, '$1jewellery$2'); txt=txt.replace(/maneuver(ab|ed|ing)/g, 'manoeuvr$1'); txt=txt.replace(/maneuver/g, 'manoeuvre'); txt=txt.replace(/ped(iatric|ophil)/g, 'paed$1'); txt=txt.replace(/skeptic/g, 'sceptic'); txt=txt.replace(/vapor(s?\W)/g, 'vapour$1');

//composite words //txt=txt.replace(/onstage/g, 'on-stage'); txt=txt.replace(/(break|lock|pick)up/g, '$1-up');

//latin words

txt=txt.replace(/gyneco/g, 'gynaeco'); txt=txt.replace(/hemo(globin|ly|phil)/g, 'haemo$1'); txt=txt.replace(/orthopedic/g, 'orthopaedic'); txt=txt.replace(/archeo/g, 'archaeo'); txt=txt.replace(/paleonto/g, 'palaeonto'); txt=txt.replace(/(\W)enology/g, '$1oenology'); txt=txt.replace(/(\W)esophag/g, '$1oesophag'); txt=txt.replace(/(\W)estrogen/g, '$1oestrogen'); txt=txt.replace(/(\W)esthetic/g, '$1aesthetic'); txt=txt.replace(/homeopath/g, 'homoeopath'); //txt=txt.replace(/medieval\b/g, 'mediaeval'); txt=txt.replace(/(\W)rigor(\W)/g, '$1rigour'); txt=txt.replace(/(an|leuk|septic|tox)emi(a|c)/g, '$1aemi$2');

//'f' words

txt=txt.replace(/sulfur/g, 'sulphur');

// non-redundant e txt=txt.replace(/(lik|liv|rat|sal|siz|shak)(able)/g, '$1e$2');

//'~our' words txt=txt.replace(/(clam|glam|harb|neighb|rum|savi?)or(ed|ful|ing|less|ly|s|)\b/g, '$1our$2'); txt=txt.replace(/neighborhood/g, 'neighbourhood'); txt=txt.replace(/behavior(al|s?\W)/g, 'behaviour$1'); txt=txt.replace(/(fav|hon)or(abl[ey]|ed|ing|s|)\b/g, '$1our$2'); txt=txt.replace(/(\W)labor(ed|ing|s?\W)/g, '$1labour$2'); txt=txt.replace(/(col|flav|hum)or(ed|ful|fully|ings?|less|lessly|s\W)/g, '$1our$2');

txt=txt.replace(/(\W)mold(ed|ing|s?\W)/g, '$1mould$2');

//'~re~' words txt=txt.replace(/\b(calib|fib|goit|lust|mit|nit|reconnoit|sab|saltpet|spect|theat|tit)er/g, '$1re'); txt=txt.replace(/(cent|epicent|recent)er(ed|ing|s)/g, '$1r$2'); txt=txt.replace(/centers/g, 'centres'); txt=txt.replace(/(centi|kilo|milli|-|\d\s)meter/g, '$1metre'); txt=txt.replace(/(centi|milli|deci|pico|hecto|\b)liter(s?\b)/g, '$1litre$2'); txt=txt.replace(/(dema|peda|mono|syna)gog(s?\W)/g, '$1gogue$2'); txt=txt.replace(/([^\\|\/|\-])(ana|cata|dia|epi|homo|mono|pro)log\b/g, '$1$2logue'); //txt=txt.replace(/(\W[a-z]{3,12}[^s])[^\b]iz(e[drs]?|ations?|ing)(\W)/g, '$1is$2$3'); //txt=txt.replace(/(empha|synthe)siz(e|ing)/g, '$1sis$2');

//'~l' words where the 'l' doubles as past and present participle txt=txt.replace(/(bev|jew|lev|mod|rev|trav)el(e[dr]|ing)/g, '$1ell$2'); txt=txt.replace(/(\b[a-z]{2,8}[^egl ])el(e[dr]|est|ing)\b/g, '$1ell$2'); txt=txt.replace(/(counci|dia)l(e[dr]|ing|or)\b/gi, '$1ll$2'); txt=txt.replace(/(app|enthr|riv|sign|tot)al(e[dr]|ing)/g, '$1all$2'); txt=txt.replace(/(\s[\w]*)ll(ful|ment)/g, '$1l$2');

//reconvert special cases txt=txt.replace(/(nobelpr|pics)ise/g, '$1ize');

// unprotectwords() box.value = txt; } function OxEnglish() {

 unprotectwords();
 protectwords();
 Simple();
 unprotectwords();
 insert_EngvarOx()
 edit_summary();

} function BritishEnglish() {

 unprotectwords();
 protectwords();
 Simple();
 zwords();
 unprotectwords();
 insert_EngvarB()
 edit_summary();

} function Simpleplus() {

 unprotectwords();
 Simple();
 zwords();
 unprotectwords();
 insert_EngvarB()
 edit_summary();

} function zwords(){

var box=document.editform.wpTextbox1;
var txt = box.value;

txt=txt.replace(/(\W[a-z]{3,12}[^s ])iz(e[drs]?|ations?|ing)(\W)/g, '$1is$2$3'); txt=txt.replace(/(empha|synthe)siz(e|ing)/g, '$1sis$2'); box.value = txt; }

function unprotectwords(){

var box=document.editform.wpTextbox1;
var txt = box.value;
txt=txt.replace(/(\w)xXx(\w)/g, '$1$2');
box.value = txt;

}

function insert_EngvarB(){

var box=document.editform.wpTextbox1;
var txt = box.value;

// Add a template to the article identifying English variant if (txt.search(//gi) == -1) { box.value='\r\n'+txt; } }

function insert_EngvarOx(){

var box=document.editform.wpTextbox1;
var txt = box.value;

// Add a template to the article identifying English variant if (txt.search(//gi) == -1) { box.value='\r\n'+txt; } }

function edit_summary(){

// Add a tag to the summary box

var form=document.editform.wpSummary;
var txt = form.value;
   var summary = "per British English";

if (txt.indexOf(summary) == -1) { if (txt.match(/[^\*\/\s][^\/\s]?\s*$/)) { txt += " | "; } txt += summary; } // document.forms.editform.wpMinoredit.checked = true;

  form.value=txt;
  document.editform.wpDiff.click();

} addOnloadHook(function () {

if(document.forms.editform) {

// addPortletLink('p-tb', 'javascript:CommonTerms()', 'Delink common terms', 't-dmy', 'Regexp common terms', , ); // addPortletLink('p-tb', 'javascript:run_formatgeneral()', 'Add metric units', 'ca-unitfixer', 'Fixes some unit formatting', , ); // addPortletLink('p-tb', 'javascript:button_delink_dates_to_dmy()', 'Delink dates to dmy', 't-dmy', 'day month', , );

 addPortletLink('p-tb', 'javascript:OxEnglish()', 'Oxford English', 'OED spelling ', 'converts to Oxford English', , );
 addPortletLink('p-tb', 'javascript:BritishEnglish()', 'British English', 'British spelling ', 'converts to Brit English', , );
 addPortletLink('p-tb', 'javascript:protectwords()', 'Protect Words', 't-mdy', 'month day', , );
 addPortletLink('p-tb', 'javascript:Simpleplus()', 'Speedy convert to British', 'British spelling ', 'converts everything to Brit English', , );
 }

});