User:Thespaceface/MetricFirstAmericanSpelling.js

for(var i = 0;i < 100; i++){ var b = document.getElementById("collapseButton" + i); if(b === null || b === undefined){ break; } b.click; } var txt = document.getElementById('mw-content-text' ); var h = txt.innerHTML.replace(/([0-9.,]+) miles \(([0-9.,]+) km\)/g,'$2 kilometers ($1 mi)'); h = h.replace(/([0-9.,]+) miles \(([0-9.,]+) km\)/g,'$2 kilometers ($1 mi)'); h = h.replace(/([0-9.,]+) miles \(([0-9.,]+) km\)/g,'$2 kilometers ($1 mi)'); h = h.replace(/([0-9.,]+–[0-9.,]+) miles \(([0-9.,]+–[0-9.,]+) km\)/g,'$2 kilometers ($1 mi)'); h = h.replace(/([0-9.,]+–[0-9.,]+) feet \(([0-9.,]+–[0-9.,]+) m\)/g,'$2 meters ($1 ft)'); h = h.replace(/([0-9.,]+–[0-9.,]+) inches \(([0-9.,]+–[0-9.,]+) mm\)/g,'$2 millimeters ($1 in)'); h = h.replace(/([0-9.,]+)-mile \(([0-9.,]+) km\)/g,'$2-kilometer ($1 mi)'); h = h.replace(/([0-9,.]+ )() miles \(([0-9.,]+) km\)/g,'$3$2 kilometers ($1 mi)'); h = h.replace(/([0-9,.]+ )() miles \(([0-9.,]+) km\)/g,'$3$2 kilometers ($1 mi)'); h = h.replace(/([0-9.,]+)-mile \(([0-9.,]+)-km\)/g,'$2-kilometer ($1-mi)'); h = h.replace(/([0-9.,]+)-foot \(([0-9.,]+) m\)/g,'$2-meter ($1 ft)'); h = h.replace(/([0-9,.]+)-mile-long \(([0-9,.]+) km\)/g,'$2-kilometer-long ($1 mi)'); h = h.replace(/([0-9,.]+ acres) \(([0-9,.]+ ha)\)/g,'$2 ($1)'); h = h.replace(/([0-9,.]+) pounds \(([0-9,.]+) kg\)/g,'$2 kilograms ($1 lb)'); h = h.replace(/([0-9,.]+ acres) \(([0-9,.]+ km 2<\/sup>)\)/g,'$2 ($1)'); h = h.replace(/([0-9,.]+ acres) \(([0-9,.]+ km 2<\/sup>)\)/g,'$2 ($1)'); h = h.replace(/([0-9,.]+ acres) \(([0-9,.]+ ha)\)/g,'$2 ($1)'); h = h.replace(/(−?[0-9,.]+) feet \((−?[0-9.,]+) m\)/g,'$2 meters ($1 ft)'); h = h.replace(/(−?[0-9,.]+) feet \((−?[0-9.,]+) m\)/g,'$2 meters ($1 ft)'); h = h.replace(/(−?[0-9,.]+ ft) \((−?[0-9,.]+ m)\)/g,'$2 ($1)'); h = h.replace(/([0-9,.]+) yards \(([0-9.,]+) m\)/g,'$2 meters ($1 yd)'); h = h.replace(/([0-9,.]+) yd \(([0-9.,]+) m\)/g,'$2 m ($1 yd)'); h = h.replace(/(−?[0-9,.]+ ft) \((−?[0-9,.]+ m)\)/g,'$2 ($1)'); h = h.replace(/(−?[0-9,.]+ ft) \((−?[0-9,.]+ m)\)/g,'$2 ($1)'); h = h.replace(/(−?[0-9,.]+ ft) \((−?[0-9,.]+ m)\)/g,'$2 ($1)'); h = h.replace(/(−?[0-9,.]+ ft) \((−?[0-9,.]+ m)\)/g,'$2 ($1)'); h = h.replace(/(−?[0-9,.]+ ft) \((−?[0-9,.]+ m)\)/g,'$2 ($1)'); h = h.replace(/(−?[0-9,.]+ ft) \((−?[0-9,.]+ m)\)/g,'$2 ($1)'); h = h.replace(/([0-9,.]+)-square-foot \((−?[0-9,.]+) m2<\/sup>\)/g,'$2-square-meter ($1 ft 2)'); h = h.replace(/([0-9,.]+ sq ft) \(([0-9,.]+ m 2<\/sup>)\)/g,'$2 ($1)'); h = h.replace(/([0-9,.]+ sq ft) \(([0-9,.]+ m 2<\/sup>)\)/g,'$2 ($1)'); h = h.replace(/([0-9,.]+) per square mile \(([0-9,.]+)\/km 2<\/sup>\)/g,'$2 per square kilometer ($1/sq mi)'); h = h.replace(/([0-9,.]+) per square mile \(([0-9,.]+)\/km²\)/g,'$2 per square kilometer ($1/sq mi)'); h = h.replace(/([0-9,.]+) per square mile \(([0-9,.]+)\/km²\)/g,'$2 per square kilometer ($1/sq mi)'); h = h.replace(/([0-9,.]+) people per square mile \(([0-9,.]+)\/km²\)/g,'$2 people per square kilometer ($1/sq mi)'); h = h.replace(/([0-9,.]+) people per square mile \(([0-9,.]+)\/km 2<\/sup>\)/g,'$2 people per square kilometer ($1/sq mi)'); h = h.replace(/([0-9,.]+) inhabitants per square mile \(([0-9,.]+)\/km 2<\/sup>\)/g,'$2 inhabitants per square kilometer ($1/sq mi)'); h = h.replace(/([0-9,.−-]+ °F) \(([0-9,.−-]+ °C)\)/g,'$2 ($1)'); h = h.replace(/([0-9,.−-]+ °F) \(([0-9,.−-]+ °C)\)/g,'$2 ($1)'); h = h.replace(/([0-9,.−-]+ F) \(([0-9,.−-]+ C)\)/g,'$2 ($1)'); h = h.replace(/([0-9,.−-]+ F) \(([0-9,.−-]+ C)\)/g,'$2 ($1)'); h = h.replace(/([0-9,.]+ mi) \(([0-9,.]+ km)\)/g,'$2 ($1)'); h = h.replace(/([0-9,.]+ sq mi) \(([0-9,.]+ km 2<\/sup>)\)/g,'$2 ($1)'); h = h.replace(/([0-9,.]+) square miles \(([0-9,.]+) km 2<\/sup>\)/g,'$2 square kilometers ($1 sq mi)'); h = h.replace(/([0-9,.]+) square miles \(([0-9,.]+) km 2<\/sup>\)/g,'$2 square kilometers ($1 sq mi)'); h = h.replace(/([0-9,.]+ sq mi) \(([0-9,.]+ km²)\)/g,'$2 ($1)'); h = h.replace(/([0-9,.]+ mi) \(([0-9,.]+ km)\)/g,'$2 ($1)'); h = h.replace(/([0-9,.]+ in) \(([0-9,.]+ cm)\)/g,'$2 ($1)'); h = h.replace(/([0-9,.]+) inches \(([0-9,.]+) cm\)/g,'$2 centimeters ($1 in)'); h = h.replace(/([0-9,.]+ in) \(([0-9,.]+ cm)\)/g,'$2 ($1)'); h = h.replace(/([0-9,.]+) inches \(([0-9,.]+) cm\)/g,'$2 centimeters ($1 in)'); h = h.replace(/([0-9,.]+ in) \(([0-9,.]+ mm)\)/g,'$2 ($1)'); h = h.replace(/([0-9,.]+) inches \(([0-9,.]+) mm\)/g,'$2 millimeters ($1 in)'); h = h.replace(/([0-9,.]+ in) \(([0-9,.]+ mm)\)/g,'$2 ($1)'); h = h.replace(/([0-9,.]+) inches \(([0-9,.]+) mm\)/g,'$2 millimeters ($1 in)'); h = h.replace(/(−?[0-9,.]+ ft) \((−?[0-9,.]+ m)\)/g,'$2 ($1)'); h = h.replace(/([0-9,.]+\/sq mi) \(([0-9,.]+\/km 2<\/sup>)\)/g,'$2 ($1)'); h = h.replace(/([0-9,.]+\/sq mi) \(([0-9,.]+\/km²)\)/g,'$2 ($1)'); h = h.replace(/([0-9,.]+ mi)() \(([0-9.,]+ km)\)/g,'$3$2 ($1)'); h = h.replace(/([0-9,.]+)-foot-wide \(([0-9.,]+) m\)/g,'$2-meter-wide ($1 ft)'); h = h.replace(/([0-9,.]+) miles per hour \(([0-9.,]+) km\/h\)/g,'$2 kilometers per hour ($1 mph)'); h = h.replace(/([0-9,.]+) miles per hour \(([0-9.,]+) kilometers per hour\)/g,'$2 kilometers per hour ($1 miles per hour)'); h = h.replace(/([0-9,.]+) mph \(([0-9.,]+) km\/h\)/g,'$2 km/h ($1 mph)'); h = h.replace(/([0-9,.]+) mph \(([0-9.,]+) km\/h\)/g,'$2 km/h ($1 mph)'); h = h.replace(/([0-9,.]+) mph \(([0-9.,]+) km\/h\)/g,'$2 km/h ($1 mph)'); h = h.replace(/a quarter mile \(400 m\)/g,'400 meters (0.25 mi)'); h = h.replace(/quarter mile \(400 m\)/g,'400 meters (0.25 mi)'); txt.innerHTML = h;