User:Ohconfucius/script/EngvarB.js and Wikipedia:Sandbox: Difference between pages
Ohconfucius (talk | contribs) tweaks to increase discriminatory power |
m assim? |
||
Line 8: | Line 8: | ||
function protectwords(){ |
function protectwords(){ |
||
var |
var box=document.editform.wpTextbox1; |
||
var txt = box.value; |
|||
//txt=txt.replace(/(\[(?:file|image):[^\.]{0,20})(?:xx)([^\.]{0,20}\.)/g, '$1$2$3'); |
|||
unprotectwords(); |
unprotectwords(); |
||
txt |
txt=txt.replace(/(<.+?>[^<]+?)(al)(uminum)([^<]+?<\/.+?>)/g, '$1$2xXx$3$4'); |
||
txt |
txt=txt.replace(/(<.+?>[^<]+?)(ar)(tifact)([^<]+?<\/.+?>)/g, '$1$2xXx$3$4'); |
||
txt |
txt=txt.replace(/(<.+?>[^<]+?)(ana|cata|hydro|para)(lyz)([^<]+?<\/.+?>)/g, '$1$2xXx$3$4'); |
||
txt |
txt=txt.replace(/(<.+?>[^<]+?)(ly)(zing)([^<]+?<\/.+?>)/g, '$1$2xXx$3$4'); |
||
txt |
txt=txt.replace(/(<.+?>[^<]+?)(di)(arrhea)([^<]+?<\/.+?>)/g, '$1$2xXx$3$4'); |
||
txt |
txt=txt.replace(/(<.+?>[^<]+?)(de)(fense)([^<]+?<\/.+?>)/g, '$1$2xXx$3$4'); |
||
txt |
txt=txt.replace(/(<.+?>[^<]+?)(of)(fense)([^<]+?<\/.+?>)/g, '$1$2xXx$3$4'); |
||
txt |
txt=txt.replace(/(<.+?>[^<]+?)(fu)(ror)([^<]+?<\/.+?>)/g, '$1$2xXx$3$4'); |
||
txt |
txt=txt.replace(/(<.+?>[^<]+?)(gr)(ay)([^<]+?<\/.+?>)/g, '$1$2xXx$3$4'); |
||
txt |
txt=txt.replace(/(<.+?>[^<]+?)(je)(welry)([^<]+?<\/.+?>)/g, '$1$2xXx$3$4'); |
||
txt |
txt=txt.replace(/(<.+?>[^<]+?)(ma)(neuver)([^<]+?<\/.+?>)/g, '$1$2xXx$3$4'); |
||
txt |
txt=txt.replace(/(<.+?>[^<]+?)(pe)(diatric)([^<]+?<\/.+?>)/g, '$1$2xXx$3$4'); |
||
txt |
txt=txt.replace(/(<.+?>[^<]+?)(pe)(dophil)([^<]+?<\/.+?>)/g, '$1$2xXx$3$4'); |
||
txt |
txt=txt.replace(/(<.+?>[^<]+?)(sk)(eptic)([^<]+?<\/.+?>)/g, '$1$2xXx$3$4'); |
||
txt |
txt=txt.replace(/(<.+?>[^<]+?)(va)(por)([^<]+?<\/.+?>)/g, '$1$2xXx$3$4'); |
||
txt |
txt=txt.replace(/(<.+?>[^<]+?)(on)(stage)([^<]+?<\/.+?>)/g, '$1$2xXx$3$4'); |
||
txt |
txt=txt.replace(/(<.+?>[^<]+?)(break|clean|lock|pick)(up)([^<]+?<\/.+?>)/g, '$1$2xXx$3$4'); |
||
txt |
txt=txt.replace(/(<.+?>[^<]+?)(he)(mo)([^<]+?<\/.+?>)/g, '$1$2xXx$3$4'); |
||
txt |
txt=txt.replace(/(<.+?>[^<]+?)(or)(thopedic)([^<]+?<\/.+?>)/g, '$1$2xXx$3$4'); |
||
txt |
txt=txt.replace(/(<.+?>[^<]+?)(ar)(cheo)([^<]+?<\/.+?>)/g, '$1$2xXx$3$4'); |
||
txt |
txt=txt.replace(/(<.+?>[^<]+?)(pa)(leonto)([^<]+?<\/.+?>)/g, '$1$2xXx$3$4'); |
||
txt |
txt=txt.replace(/(<.+?>[^<]+?)(en)(ology)([^<]+?<\/.+?>)/g, '$1$2xXx$3$4'); |
||
txt |
txt=txt.replace(/(<.+?>[^<]+?)(es)(ophag)([^<]+?<\/.+?>)/g, '$1$2xXx$3$4'); |
||
txt |
txt=txt.replace(/(<.+?>[^<]+?)(es)(trogen)([^<]+?<\/.+?>)/g, '$1$2xXx$3$4'); |
||
txt |
txt=txt.replace(/(<.+?>[^<]+?)(es)(thetic)([^<]+?<\/.+?>)/g, '$1$2xXx$3$4'); |
||
txt |
txt=txt.replace(/(<.+?>[^<]+?)(ho)(meopath)([^<]+?<\/.+?>)/g, '$1$2xXx$3$4'); |
||
txt |
txt=txt.replace(/(<.+?>[^<]+?)(me)(dieval)([^<]+?<\/.+?>)/g, '$1$2xXx$3$4'); |
||
txt |
txt=txt.replace(/(<.+?>[^<]+?)(ri)(gor)([^<]+?<\/.+?>)/g, '$1$2xXx$3$4'); |
||
txt |
txt=txt.replace(/(<.+?>[^<]+?)(an|leuk|septic|tox)(emi)([^<]+?<\/.+?>)/g, '$1$2xXx$3$4'); |
||
txt |
txt=txt.replace(/(<.+?>[^<]+?)(su)(lfur)([^<]+?<\/.+?>)/g, '$1$2xXx$3$4'); |
||
txt |
txt=txt.replace(/(<.+?>[^<]+?)(lik|liv|rat|sal|siz|shak)(able)([^<]+?<\/.+?>)/g, '$1$2xXx$3$4'); |
||
txt |
txt=txt.replace(/(<.+?>[^<]+?)(clam|glam|harb|neighb|rum|savi?)(or)([^<]+?<\/.+?>)/g, '$1$2xXx$3$4'); |
||
txt |
txt=txt.replace(/(<.+?>[^<]+?)(behavi|col|fl?av|hon|hum|lab)(or)([^<]+?<\/.+?>)/g, '$1$2xXx$3$4'); |
||
txt |
txt=txt.replace(/(<.+?>[^<]+?)(mo)(ld)([^<]+?<\/.+?>)/g, '$1$2xXx$3$4'); |
||
txt |
txt=txt.replace(/(<.+?>[^<]+?)(calib|fib|goit|lust|mit|nit|reconnoit|sab|saltpet|spect|theat|tit)(er)([^<]+?<\/.+?>)/g, '$1$2xXx$3$4'); |
||
txt |
txt=txt.replace(/(<.+?>[^<]+?)(cent|epicent|recent)(er)([^<]+?<\/.+?>)/g, '$1$2xXx$3$4'); |
||
txt |
txt=txt.replace(/(<.+?>[^<]+?)(centi|kilo|milli|\d\s)(meter)([^<]+?<\/.+?>)/g, '$1$2xXx$3$4'); |
||
txt |
txt=txt.replace(/(<.+?>[^<]+?)(centi|milli|deci|pico|hecto)(liter)([^<]+?<\/.+?>)/g, '$1$2xXx$3$4'); |
||
txt |
txt=txt.replace(/(<.+?>[^<]+?)(dema|peda|mono|syna)(gog)([^<]+?<\/.+?>)/g, '$1$2xXx$3$4'); |
||
txt |
txt=txt.replace(/(<.+?>[^<]+?)(ana|cata|dia|epi|homo|mono|pro)(log)([^<]+?<\/.+?>)/g, '$1$2xXx$3$4'); |
||
txt |
txt=txt.replace(/(<.+?>[^<]+?)(iz)(e[drs]?|ations?|ing)([^<]+?<\/.+?>)/g, '$1$2xXx$3$4'); |
||
txt |
txt=txt.replace(/(<.+?>[^<]+?)(el)(e[dr]|est|ing)([^<]+?<\/.+?>)/g, '$1$2xXx$3$4'); |
||
txt |
txt=txt.replace(/(<.+?>[^<]+?)(counci|dia)(le[dr]|ling|lor)([^<]+?<\/.+?>)/g, '$1$2xXx$3$4'); |
||
txt |
txt=txt.replace(/(<.+?>[^<]+?)(app|enthr|riv|sign|tot)(ale[dr]|aling)([^<]+?<\/.+?>)/g, '$1$2xXx$3$4'); |
||
txt |
txt=txt.replace(/(\[Category:[^\]]*?)(al)(uminum)([^\]]*?\])/g, '$1$2xXx$3$4'); |
||
txt |
txt=txt.replace(/(\[Category:[^\]]*?)(ar)(tifact)([^\]]*?\])/g, '$1$2xXx$3$4'); |
||
txt |
txt=txt.replace(/(\[Category:[^\]]*?)(ana|cata|hydro|para)(lyz)([^\]]*?\])/g, '$1$2xXx$3$4'); |
||
txt |
txt=txt.replace(/(\[Category:[^\]]*?)(ly)(zing)([^\]]*?\])/g, '$1$2xXx$3$4'); |
||
//txt |
//txt=txt.replace(/(\[Category:[^\]]*?)(di)(arrhea)([^\]]*?\])/g, '$1$2xXx$3$4'); |
||
//txt |
//txt=txt.replace(/(\[Category:[^\]]*?)(de)(fense)([^\]]*?\])/g, '$1$2xXx$3$4'); |
||
//txt |
//txt=txt.replace(/(\[Category:[^\]]*?)(of)(fense)([^\]]*?\])/g, '$1$2xXx$3$4'); |
||
//txt |
//txt=txt.replace(/(\[Category:[^\]]*?)(fu)(ror)([^\]]*?\])/g, '$1$2xXx$3$4'); |
||
txt |
txt=txt.replace(/(\[Category:[^\]]*?)(gr)(ay)([^\]]*?\])/g, '$1$2xXx$3$4'); |
||
txt |
txt=txt.replace(/(\[Category:[^\]]*?)(je)(welry)([^\]]*?\])/g, '$1$2xXx$3$4'); |
||
//txt |
//txt=txt.replace(/(\[Category:[^\]]*?)(ma)(neuver)([^\]]*?\])/g, '$1$2xXx$3$4'); |
||
txt |
txt=txt.replace(/(\[Category:[^\]]*?)(pe)(diatric)([^\]]*?\])/g, '$1$2xXx$3$4'); |
||
txt |
txt=txt.replace(/(\[Category:[^\]]*?)(pe)(dophil)([^\]]*?\])/g, '$1$2xXx$3$4'); |
||
txt |
txt=txt.replace(/(\[Category:[^\]]*?)(sk)(eptic)([^\]]*?\])/g, '$1$2xXx$3$4'); |
||
//txt |
//txt=txt.replace(/(\[Category:[^\]]*?)(va)(por)([^\]]*?\])/g, '$1$2xXx$3$4'); |
||
//txt |
//txt=txt.replace(/(\[Category:[^\]]*?)(on)(stage)([^\]]*?\])/g, '$1$2xXx$3$4'); |
||
//txt |
//txt=txt.replace(/(\[Category:[^\]]*?)(break|clean|lock|pick)(up)([^\]]*?\])/g, '$1$2xXx$3$4'); |
||
txt |
txt=txt.replace(/(\[Category:[^\]]*?)(he)(mo)([^\]]*?\])/g, '$1$2xXx$3$4'); |
||
txt |
txt=txt.replace(/(\[Category:[^\]]*?)(or)(thopedic)([^\]]*?\])/g, '$1$2xXx$3$4'); |
||
txt |
txt=txt.replace(/(\[Category:[^\]]*?)(ar)(cheo)([^\]]*?\])/g, '$1$2xXx$3$4'); |
||
txt |
txt=txt.replace(/(\[Category:[^\]]*?)(pa)(leonto)([^\]]*?\])/g, '$1$2xXx$3$4'); |
||
txt |
txt=txt.replace(/(\[Category:[^\]]*?)(en)(ology)([^\]]*?\])/g, '$1$2xXx$3$4'); |
||
//txt |
//txt=txt.replace(/(\[Category:[^\]]*?)(es)(ophag)([^\]]*?\])/g, '$1$2xXx$3$4'); |
||
//txt |
//txt=txt.replace(/(\[Category:[^\]]*?)(es)(trogen)([^\]]*?\])/g, '$1$2xXx$3$4'); |
||
txt |
txt=txt.replace(/(\[Category:[^\]]*?)(es)(thetic)([^\]]*?\])/g, '$1$2xXx$3$4'); |
||
txt |
txt=txt.replace(/(\[Category:[^\]]*?)(ho)(meopath)([^\]]*?\])/g, '$1$2xXx$3$4'); |
||
txt |
txt=txt.replace(/(\[Category:[^\]]*?)(me)(dieval)([^\]]*?\])/g, '$1$2xXx$3$4'); |
||
//txt |
//txt=txt.replace(/(\[Category:[^\]]*?)(ri)(gor)([^\]]*?\])/g, '$1$2xXx$3$4'); |
||
txt |
txt=txt.replace(/(\[Category:[^\]]*?)(an|leuk|septic|tox)(emi)([^\]]*?\])/g, '$1$2xXx$3$4'); |
||
txt |
txt=txt.replace(/(\[Category:[^\]]*?)(su)(lfur)([^\]]*?\])/g, '$1$2xXx$3$4'); |
||
//txt |
//txt=txt.replace(/(\[Category:[^\]]*?)(lik|liv|rat|sal|siz|shak)(able)([^\]]*?\])/g, '$1$2xXx$3$4'); |
||
txt |
txt=txt.replace(/(\[Category:[^\]]*?)(clam|glam|harb|neighb|rum|savi?)(or)([^\]]*?\])/g, '$1$2xXx$3$4'); |
||
txt |
txt=txt.replace(/(\[Category:[^\]]*?)(behavi|col|fl?av|hon|hum|lab)(or)([^\]]*?\])/g, '$1$2xXx$3$4'); |
||
txt |
txt=txt.replace(/(\[Category:[^\]]*?)(mo)(ld)([^\]]*?\])/g, '$1$2xXx$3$4'); |
||
//txt |
//txt=txt.replace(/(\[Category:[^\]]*?)(calib|fib|goit|lust|mit|nit|reconnoit|sab|saltpet|spect|theat|tit)(er)([^\]]*?\])/g, '$1$2xXx$3$4'); |
||
txt |
txt=txt.replace(/(\[Category:[^\]]*?)(cent|epicent|recent)(er)([^\]]*?\])/g, '$1$2xXx$3$4'); |
||
//txt |
//txt=txt.replace(/(\[Category:[^\]]*?)(centi|kilo|milli|\d\s)(meter)([^\]]*?\])/g, '$1$2xXx$3$4'); |
||
//txt |
//txt=txt.replace(/(\[Category:[^\]]*?)(centi|milli|deci|pico|hecto)(liter)([^\]]*?\])/g, '$1$2xXx$3$4'); |
||
txt |
txt=txt.replace(/(\[Category:[^\]]*?)(dema|peda|mono|syna)(gog)([^\]]*?\])/g, '$1$2xXx$3$4'); |
||
txt |
txt=txt.replace(/(\[Category:[^\]]*?)(ana|cata|dia|epi|homo|mono|pro)(log)([^\]]*?\])/g, '$1$2xXx$3$4'); |
||
txt |
txt=txt.replace(/(\[Category:[^\]]*?)(iz)(e[drs]?|ations?|ing)([^\]]*?\])/g, '$1$2xXx$3$4'); |
||
txt |
txt=txt.replace(/(\[Category:[^\]]*?)(el)(e[dr]|est|ing)([^\]]*?\])/g, '$1$2xXx$3$4'); |
||
txt |
txt=txt.replace(/(\[Category:[^\]]*?)(counci|dia)(le[dr]|ling|lor)([^\]]*?\])/g, '$1$2xXx$3$4'); |
||
//txt |
//txt=txt.replace(/(\[Category:[^\]]*?)(app|enthr|riv|sign|tot)(ale[dr]|aling)([^\]]*?\])/g, '$1$2xXx$3$4'); |
||
txt |
txt=txt.replace(/(\[(?:file|image):[^\.]{0,20})(al)(uminum)([^\.]{0,20}\.)/g, '$1$2xXx$3$4'); |
||
txt |
txt=txt.replace(/(\[(?:file|image):[^\.]{0,20})(ar)(tifact)([^\.]{0,20}\.)/g, '$1$2xXx$3$4'); |
||
txt |
txt=txt.replace(/(\[(?:file|image):[^\.]{0,20})(ana|cata|hydro|para)(lyz)([^\.]{0,20}\.)/g, '$1$2xXx$3$4'); |
||
txt |
txt=txt.replace(/(\[(?:file|image):[^\.]{0,20})(ly)(zing)([^\.]{0,20}\.)/g, '$1$2xXx$3$4'); |
||
txt |
txt=txt.replace(/(\[(?:file|image):[^\.]{0,20})(di)(arrhea)([^\.]{0,20}\.)/g, '$1$2xXx$3$4'); |
||
txt |
txt=txt.replace(/(\[(?:file|image):[^\.]{0,20})(de)(fense)([^\.]{0,20}\.)/g, '$1$2xXx$3$4'); |
||
txt |
txt=txt.replace(/(\[(?:file|image):[^\.]{0,20})(of)(fense)([^\.]{0,20}\.)/g, '$1$2xXx$3$4'); |
||
txt |
txt=txt.replace(/(\[(?:file|image):[^\.]{0,20})(fu)(ror)([^\.]{0,20}\.)/g, '$1$2xXx$3$4'); |
||
txt |
txt=txt.replace(/(\[(?:file|image):[^\.]{0,20})(gr)(ay)([^\.]{0,20}\.)/g, '$1$2xXx$3$4'); |
||
txt |
txt=txt.replace(/(\[(?:file|image):[^\.]{0,20})(je)(welry)([^\.]{0,20}\.)/g, '$1$2xXx$3$4'); |
||
txt |
txt=txt.replace(/(\[(?:file|image):[^\.]{0,20})(ma)(neuver)([^\.]{0,20}\.)/g, '$1$2xXx$3$4'); |
||
txt |
txt=txt.replace(/(\[(?:file|image):[^\.]{0,20})(pe)(diatric)([^\.]{0,20}\.)/g, '$1$2xXx$3$4'); |
||
txt |
txt=txt.replace(/(\[(?:file|image):[^\.]{0,20})(pe)(dophil)([^\.]{0,20}\.)/g, '$1$2xXx$3$4'); |
||
txt |
txt=txt.replace(/(\[(?:file|image):[^\.]{0,20})(sk)(eptic)([^\.]{0,20}\.)/g, '$1$2xXx$3$4'); |
||
txt |
txt=txt.replace(/(\[(?:file|image):[^\.]{0,20})(va)(por)([^\.]{0,20}\.)/g, '$1$2xXx$3$4'); |
||
txt |
txt=txt.replace(/(\[(?:file|image):[^\.]{0,20})(on)(stage)([^\.]{0,20}\.)/g, '$1$2xXx$3$4'); |
||
txt |
txt=txt.replace(/(\[(?:file|image):[^\.]{0,20})(break|clean|lock|pick)(up)([^\.]{0,20}\.)/g, '$1$2xXx$3$4'); |
||
txt |
txt=txt.replace(/(\[(?:file|image):[^\.]{0,20})(he)(mo)([^\.]{0,20}\.)/g, '$1$2xXx$3$4'); |
||
txt |
txt=txt.replace(/(\[(?:file|image):[^\.]{0,20})(or)(thopedic)([^\.]{0,20}\.)/g, '$1$2xXx$3$4'); |
||
txt |
txt=txt.replace(/(\[(?:file|image):[^\.]{0,20})(ar)(cheo)([^\.]{0,20}\.)/g, '$1$2xXx$3$4'); |
||
txt |
txt=txt.replace(/(\[(?:file|image):[^\.]{0,20})(pa)(leonto)([^\.]{0,20}\.)/g, '$1$2xXx$3$4'); |
||
txt |
txt=txt.replace(/(\[(?:file|image):[^\.]{0,20})(en)(ology)([^\.]{0,20}\.)/g, '$1$2xXx$3$4'); |
||
txt |
txt=txt.replace(/(\[(?:file|image):[^\.]{0,20})(es)(ophag)([^\.]{0,20}\.)/g, '$1$2xXx$3$4'); |
||
txt |
txt=txt.replace(/(\[(?:file|image):[^\.]{0,20})(es)(trogen)([^\.]{0,20}\.)/g, '$1$2xXx$3$4'); |
||
txt |
txt=txt.replace(/(\[(?:file|image):[^\.]{0,20})(es)(thetic)([^\.]{0,20}\.)/g, '$1$2xXx$3$4'); |
||
txt |
txt=txt.replace(/(\[(?:file|image):[^\.]{0,20})(ho)(meopath)([^\.]{0,20}\.)/g, '$1$2xXx$3$4'); |
||
txt |
txt=txt.replace(/(\[(?:file|image):[^\.]{0,20})(me)(dieval)([^\.]{0,20}\.)/g, '$1$2xXx$3$4'); |
||
txt |
txt=txt.replace(/(\[(?:file|image):[^\.]{0,20})(ri)(gor)([^\.]{0,20}\.)/g, '$1$2xXx$3$4'); |
||
txt |
txt=txt.replace(/(\[(?:file|image):[^\.]{0,20})(an|leuk|septic|tox)(emi)([^\.]{0,20}\.)/g, '$1$2xXx$3$4'); |
||
txt |
txt=txt.replace(/(\[(?:file|image):[^\.]{0,20})(su)(lfur)([^\.]{0,20}\.)/g, '$1$2xXx$3$4'); |
||
txt |
txt=txt.replace(/(\[(?:file|image):[^\.]{0,20})(lik|liv|rat|sal|siz|shak)(able)([^\.]{0,20}\.)/g, '$1$2xXx$3$4'); |
||
txt |
txt=txt.replace(/(\[(?:file|image):[^\.]{0,20})(clam|glam|harb|neighb|rum|savi?)(or)([^\.]{0,20}\.)/g, '$1$2xXx$3$4'); |
||
txt |
txt=txt.replace(/(\[(?:file|image):[^\.]{0,20})(behavi|col|fl?av|hon|hum|lab)(or)([^\.]{0,20}\.)/g, '$1$2xXx$3$4'); |
||
txt |
txt=txt.replace(/(\[(?:file|image):[^\.]{0,20})(mo)(ld)([^\.]{0,20}\.)/g, '$1$2xXx$3$4'); |
||
txt |
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=txt.replace(/(\[(?:file|image):[^\.]{0,20})(cent|epicent|recent)(er)([^\.]{0,20}\.)/g, '$1$2xXx$3$4'); |
||
txt |
txt=txt.replace(/(\[(?:file|image):[^\.]{0,20})(centi|kilo|milli|\d\s)(meter)([^\.]{0,20}\.)/g, '$1$2xXx$3$4'); |
||
txt |
txt=txt.replace(/(\[(?:file|image):[^\.]{0,20})(centi|milli|deci|pico|hecto)(liter)([^\.]{0,20}\.)/g, '$1$2xXx$3$4'); |
||
txt |
txt=txt.replace(/(\[(?:file|image):[^\.]{0,20})(dema|peda|mono|syna)(gog)([^\.]{0,20}\.)/g, '$1$2xXx$3$4'); |
||
txt |
txt=txt.replace(/(\[(?:file|image):[^\.]{0,20})(ana|cata|dia|epi|homo|mono|pro)(log)([^\.]{0,20}\.)/g, '$1$2xXx$3$4'); |
||
txt |
txt=txt.replace(/(\[(?:file|image):[^\.]{0,20})(iz)(e[drs]?|ations?|ing)([^\.]{0,20}\.)/g, '$1$2xXx$3$4'); |
||
txt |
txt=txt.replace(/(\[(?:file|image):[^\.]{0,20})(bev|jew|lev|mod|rev|trav)(el)([^\.]{0,20}\.)/g, '$1$2xXx$3$4'); |
||
txt |
txt=txt.replace(/(\[(?:file|image):[^\.]{0,20})([a-z]{2,8}[^egl\b])(el)([^\.]{0,20}\.)/g, '$1$2xXx$3$4'); |
||
txt |
txt=txt.replace(/(\[(?:file|image):[^\.]{0,20})(counci|dia)(le[dr]|ling|lor)([^\.]{0,20}\.)/g, '$1$2xXx$3$4'); |
||
txt |
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 |
txt=txt.replace(/({[^{]{0,6}quot[^\|]{1,7}\s?\|[^}]*?)(al)(uminum)([^}]*?})/g, '$1$2xXx$3$4'); |
||
txt |
txt=txt.replace(/({[^{]{0,6}quot[^\|]{1,7}\s?\|[^}]*?)(ar)(tifact)([^}]*?})/g, '$1$2xXx$3$4'); |
||
txt |
txt=txt.replace(/({[^{]{0,6}quot[^\|]{1,7}\s?\|[^}]*?)(ana|cata|hydro|para)(lyz)([^}]*?})/g, '$1$2xXx$3$4'); |
||
txt |
txt=txt.replace(/({[^{]{0,6}quot[^\|]{1,7}\s?\|[^}]*?)(ly)(zing)([^}]*?})/g, '$1$2xXx$3$4'); |
||
txt |
txt=txt.replace(/({[^{]{0,6}quot[^\|]{1,7}\s?\|[^}]*?)(di)(arrhea)([^}]*?})/g, '$1$2xXx$3$4'); |
||
txt |
txt=txt.replace(/({[^{]{0,6}quot[^\|]{1,7}\s?\|[^}]*?)(de)(fense)([^}]*?})/g, '$1$2xXx$3$4'); |
||
txt |
txt=txt.replace(/({[^{]{0,6}quot[^\|]{1,7}\s?\|[^}]*?)(of)(fense)([^}]*?})/g, '$1$2xXx$3$4'); |
||
txt |
txt=txt.replace(/({[^{]{0,6}quot[^\|]{1,7}\s?\|[^}]*?)(fu)(ror)([^}]*?})/g, '$1$2xXx$3$4'); |
||
txt |
txt=txt.replace(/({[^{]{0,6}quot[^\|]{1,7}\s?\|[^}]*?)(gr)(ay)([^}]*?})/g, '$1$2xXx$3$4'); |
||
txt |
txt=txt.replace(/({[^{]{0,6}quot[^\|]{1,7}\s?\|[^}]*?)(je)(welry)([^}]*?})/g, '$1$2xXx$3$4'); |
||
txt |
txt=txt.replace(/({[^{]{0,6}quot[^\|]{1,7}\s?\|[^}]*?)(ma)(neuver)([^}]*?})/g, '$1$2xXx$3$4'); |
||
txt |
txt=txt.replace(/({[^{]{0,6}quot[^\|]{1,7}\s?\|[^}]*?)(pe)(diatric)([^}]*?})/g, '$1$2xXx$3$4'); |
||
txt |
txt=txt.replace(/({[^{]{0,6}quot[^\|]{1,7}\s?\|[^}]*?)(pe)(dophil)([^}]*?})/g, '$1$2xXx$3$4'); |
||
txt |
txt=txt.replace(/({[^{]{0,6}quot[^\|]{1,7}\s?\|[^}]*?)(sk)(eptic)([^}]*?})/g, '$1$2xXx$3$4'); |
||
txt |
txt=txt.replace(/({[^{]{0,6}quot[^\|]{1,7}\s?\|[^}]*?)(va)(por)([^}]*?})/g, '$1$2xXx$3$4'); |
||
txt |
txt=txt.replace(/({[^{]{0,6}quot[^\|]{1,7}\s?\|[^}]*?)(on)(stage)([^}]*?})/g, '$1$2xXx$3$4'); |
||
txt |
txt=txt.replace(/({[^{]{0,6}quot[^\|]{1,7}\s?\|[^}]*?)(break|clean|lock|pick)(up)([^}]*?})/g, '$1$2xXx$3$4'); |
||
txt |
txt=txt.replace(/({[^{]{0,6}quot[^\|]{1,7}\s?\|[^}]*?)(he)(mo)([^}]*?})/g, '$1$2xXx$3$4'); |
||
txt |
txt=txt.replace(/({[^{]{0,6}quot[^\|]{1,7}\s?\|[^}]*?)(or)(thopedic)([^}]*?})/g, '$1$2xXx$3$4'); |
||
txt |
txt=txt.replace(/({[^{]{0,6}quot[^\|]{1,7}\s?\|[^}]*?)(ar)(cheo)([^}]*?})/g, '$1$2xXx$3$4'); |
||
txt |
txt=txt.replace(/({[^{]{0,6}quot[^\|]{1,7}\s?\|[^}]*?)(pa)(leonto)([^}]*?})/g, '$1$2xXx$3$4'); |
||
txt |
txt=txt.replace(/({[^{]{0,6}quot[^\|]{1,7}\s?\|[^}]*?)(en)(ology)([^}]*?})/g, '$1$2xXx$3$4'); |
||
txt |
txt=txt.replace(/({[^{]{0,6}quot[^\|]{1,7}\s?\|[^}]*?)(es)(ophag)([^}]*?})/g, '$1$2xXx$3$4'); |
||
txt |
txt=txt.replace(/({[^{]{0,6}quot[^\|]{1,7}\s?\|[^}]*?)(es)(trogen)([^}]*?})/g, '$1$2xXx$3$4'); |
||
txt |
txt=txt.replace(/({[^{]{0,6}quot[^\|]{1,7}\s?\|[^}]*?)(es)(thetic)([^}]*?})/g, '$1$2xXx$3$4'); |
||
txt |
txt=txt.replace(/({[^{]{0,6}quot[^\|]{1,7}\s?\|[^}]*?)(ho)(meopath)([^}]*?})/g, '$1$2xXx$3$4'); |
||
txt |
txt=txt.replace(/({[^{]{0,6}quot[^\|]{1,7}\s?\|[^}]*?)(me)(dieval)([^}]*?})/g, '$1$2xXx$3$4'); |
||
txt |
txt=txt.replace(/({[^{]{0,6}quot[^\|]{1,7}\s?\|[^}]*?)(ri)(gor)([^}]*?})/g, '$1$2xXx$3$4'); |
||
txt |
txt=txt.replace(/({[^{]{0,6}quot[^\|]{1,7}\s?\|[^}]*?)(an|leuk|septic|tox)(emi)([^}]*?})/g, '$1$2xXx$3$4'); |
||
txt |
txt=txt.replace(/({[^{]{0,6}quot[^\|]{1,7}\s?\|[^}]*?)(su)(lfur)([^}]*?})/g, '$1$2xXx$3$4'); |
||
txt |
txt=txt.replace(/({[^{]{0,6}quot[^\|]{1,7}\s?\|[^}]*?)(lik|liv|rat|sal|siz|shak)(able)([^}]*?})/g, '$1$2xXx$3$4'); |
||
txt |
txt=txt.replace(/({[^{]{0,6}quot[^\|]{1,7}\s?\|[^}]*?)(clam|glam|harb|neighb|rum|savi?)(or)([^}]*?})/g, '$1$2xXx$3$4'); |
||
txt |
txt=txt.replace(/({[^{]{0,6}quot[^\|]{1,7}\s?\|[^}]*?)(behavi|col|fl?av|hon|hum|lab)(or)([^}]*?})/g, '$1$2xXx$3$4'); |
||
txt |
txt=txt.replace(/({[^{]{0,6}quot[^\|]{1,7}\s?\|[^}]*?)(mo)(ld)([^}]*?})/g, '$1$2xXx$3$4'); |
||
txt |
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=txt.replace(/({[^{]{0,6}quot[^\|]{1,7}\s?\|[^}]*?)(cent|epicent|recent)(er)([^}]*?})/g, '$1$2xXx$3$4'); |
||
txt |
txt=txt.replace(/({[^{]{0,6}quot[^\|]{1,7}\s?\|[^}]*?)(centi|kilo|milli|\d\s)(meter)([^}]*?})/g, '$1$2xXx$3$4'); |
||
txt |
txt=txt.replace(/({[^{]{0,6}quot[^\|]{1,7}\s?\|[^}]*?)(centi|milli|deci|pico|hecto)(liter)([^}]*?})/g, '$1$2xXx$3$4'); |
||
txt |
txt=txt.replace(/({[^{]{0,6}quot[^\|]{1,7}\s?\|[^}]*?)(dema|peda|mono|syna)(gog)([^}]*?})/g, '$1$2xXx$3$4'); |
||
txt |
txt=txt.replace(/({[^{]{0,6}quot[^\|]{1,7}\s?\|[^}]*?)(ana|cata|dia|epi|homo|mono|pro)(log)([^}]*?})/g, '$1$2xXx$3$4'); |
||
txt |
txt=txt.replace(/({[^{]{0,6}quot[^\|]{1,7}\s?\|[^}]*?)(iz)(e[drs]?|ations?|ing)([^}]*?})/g, '$1$2xXx$3$4'); |
||
txt |
txt=txt.replace(/({[^{]{0,6}quot[^\|]{1,7}\s?\|[^}]*?)(el)(e[dr]|est|ing)([^}]*?})/g, '$1$2xXx$3$4'); |
||
txt |
txt=txt.replace(/({[^{]{0,6}quot[^\|]{1,7}\s?\|[^}]*?)(counci|dia)(le[dr]|ling|lor)([^}]*?})/g, '$1$2xXx$3$4'); |
||
txt |
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 |
var box=document.editform.wpTextbox1; |
||
var txt = box.value; |
|||
//protectwords() |
//protectwords() |
||
txt |
txt=txt.replace(/aluminum/g, 'aluminium'); |
||
txt |
txt=txt.replace(/artifact/g, 'artefact'); |
||
txt |
txt=txt.replace(/(ana|cata|hydro|para)lyz(e|ing)/g, '$1lys$2'); |
||
txt |
txt=txt.replace(/diarrhea/g, 'diarrhoea'); |
||
txt |
txt=txt.replace(/(de|of)fense/g, '$1fence'); |
||
txt |
txt=txt.replace(/(\W)furor(\W)/g, '$1furore$2'); |
||
txt |
txt=txt.replace(/(light\s|dark\s|\s)gray/g, '$1grey'); |
||
//txt |
//txt=txt.replace(/judgment/g, 'judgement'); |
||
txt |
txt=txt.replace(/(\W)jewelry(\W)/g, '$1jewellery$2'); |
||
txt |
txt=txt.replace(/maneuver(ab|ed|ing)/g, 'manoeuvr$1'); |
||
txt |
txt=txt.replace(/maneuver/g, 'manoeuvre'); |
||
txt |
txt=txt.replace(/ped(iatric|ophil)/g, 'paed$1'); |
||
txt |
txt=txt.replace(/skeptic/g, 'sceptic'); |
||
txt |
txt=txt.replace(/vapor(s?\W)/g, 'vapour$1'); |
||
//composite words |
//composite words |
||
//txt |
//txt=txt.replace(/onstage/g, 'on-stage'); |
||
txt |
txt=txt.replace(/(break|lock|pick)up/g, '$1-up'); |
||
//latin words |
//latin words |
||
txt |
txt=txt.replace(/gyneco/g, 'gynaeco'); |
||
txt |
txt=txt.replace(/hemo(globin|ly|phil)/g, 'haemo$1'); |
||
txt |
txt=txt.replace(/orthopedic/g, 'orthopaedic'); |
||
txt |
txt=txt.replace(/archeo/g, 'archaeo'); |
||
txt |
txt=txt.replace(/paleonto/g, 'palaeonto'); |
||
txt |
txt=txt.replace(/(\W)enology/g, '$1oenology'); |
||
txt |
txt=txt.replace(/(\W)esophag/g, '$1oesophag'); |
||
txt |
txt=txt.replace(/(\W)estrogen/g, '$1oestrogen'); |
||
txt |
txt=txt.replace(/(\W)esthetic/g, '$1aesthetic'); |
||
txt |
txt=txt.replace(/homeopath/g, 'homoeopath'); |
||
//txt |
//txt=txt.replace(/medieval\b/g, 'mediaeval'); |
||
txt |
txt=txt.replace(/(\W)rigor(\W)/g, '$1rigour'); |
||
txt |
txt=txt.replace(/(an|leuk|septic|tox)emi(a|c)/g, '$1aemi$2'); |
||
//'f' words |
//'f' words |
||
txt |
txt=txt.replace(/sulfur/g, 'sulphur'); |
||
// non-redundant e |
// non-redundant e |
||
txt |
txt=txt.replace(/(lik|liv|rat|sal|siz|shak)(able)/g, '$1e$2'); |
||
//'~our' words |
//'~our' words |
||
txt |
txt=txt.replace(/(clam|glam|harb|neighb|rum|savi?)or(ed|ful|ing|less|ly|s|)\b/g, '$1our$2'); |
||
txt |
txt=txt.replace(/neighborhood/g, 'neighbourhood'); |
||
txt |
txt=txt.replace(/behavior(al|s?\W)/g, 'behaviour$1'); |
||
txt |
txt=txt.replace(/(fav|hon)or(abl[ey]|ed|ing|s|)\b/g, '$1our$2'); |
||
txt |
txt=txt.replace(/(\W)labor(ed|ing|s?\W)/g, '$1labour$2'); |
||
txt |
txt=txt.replace(/(col|flav|hum)or(ed|ful|fully|ings?|less|lessly|s\W)/g, '$1our$2'); |
||
txt |
txt=txt.replace(/(\W)mold(ed|ing|s?\W)/g, '$1mould$2'); |
||
//'~re~' words |
//'~re~' words |
||
txt |
txt=txt.replace(/\b(calib|fib|goit|lust|mit|nit|reconnoit|sab|saltpet|spect|theat|tit)er/g, '$1re'); |
||
txt |
txt=txt.replace(/(cent|epicent|recent)er(ed|ing|s)/g, '$1r$2'); |
||
txt |
txt=txt.replace(/centers/g, 'centres'); |
||
txt |
txt=txt.replace(/(centi|kilo|milli|-|\d\s)meter/g, '$1metre'); |
||
txt |
txt=txt.replace(/(centi|milli|deci|pico|hecto|\b)liter(s?\b)/g, '$1litre$2'); |
||
txt |
txt=txt.replace(/(dema|peda|mono|syna)gog(s?\W)/g, '$1gogue$2'); |
||
txt |
txt=txt.replace(/([^\\|\/|\-])(ana|cata|dia|epi|homo|mono|pro)log\b/g, '$1$2logue'); |
||
//txt |
//txt=txt.replace(/(\W[a-z]{3,12}[^s])[^\b]iz(e[drs]?|ations?|ing)(\W)/g, '$1is$2$3'); |
||
//txt |
//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 |
txt=txt.replace(/(bev|jew|lev|mod|rev|trav)el(e[dr]|ing)/g, '$1ell$2'); |
||
txt |
txt=txt.replace(/(\b[a-z]{2,8}[^egl ])el(e[dr]|est|ing)\b/g, '$1ell$2'); |
||
txt |
txt=txt.replace(/(counci|dia)l(e[dr]|ing|or)\b/gi, '$1ll$2'); |
||
txt |
txt=txt.replace(/(app|enthr|riv|sign|tot)al(e[dr]|ing)/g, '$1all$2'); |
||
txt |
txt=txt.replace(/(\s[\w]*)ll(ful|ment)/g, '$1l$2'); |
||
//reconvert special cases |
//reconvert special cases |
||
txt |
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 |
var box=document.editform.wpTextbox1; |
||
var txt = box.value; |
|||
⚫ | |||
⚫ | |||
⚫ | |||
⚫ | |||
box.value = txt; |
|||
} |
} |
||
function unprotectwords(){ |
function unprotectwords(){ |
||
var |
var box=document.editform.wpTextbox1; |
||
var txt = box.value; |
|||
⚫ | |||
⚫ | |||
box.value = txt; |
|||
} |
} |
||
function insert_EngvarB(){ |
function insert_EngvarB(){ |
||
var |
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 |
if (txt.search(/{{EngvarB}}/gi) == -1) |
||
{ |
{ |
||
box.value='{{EngvarB}}\r\n'+txt; |
|||
} |
} |
||
} |
} |
||
function insert_EngvarOx(){ |
function insert_EngvarOx(){ |
||
var |
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 |
if (txt.search(/{{EngvarB}}/gi) == -1) |
||
{ |
{ |
||
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 |
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 |
if (txt.indexOf(summary) == -1) { |
||
if (txt |
if (txt.match(/[^\*\/\s][^\/\s]?\s*$/)) { |
||
txt |
txt += " | "; |
||
} |
} |
||
txt |
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', , ); }
});