User:Thespaceface/CustomUnits/WorldMetric1.js

var txt = document.getElementById('mw-content-text' ); var h = txt.innerHTML.replace(/([0-9.,]+) miles \(([0-9.,]+) km\)/g,'$2 kilometres ($1 mi)'); h = h.replace(/([0-9.,]+) miles \(([0-9.,]+) km\)/g,'$2 kilometres ($1 mi)'); h = h.replace(/([0-9.,]+) miles \(([0-9.,]+) km\)/g,'$2 kilometres ($1 mi)'); h = h.replace(/([0-9.,]+–[0-9.,]+) miles \(([0-9.,]+–[0-9.,]+) km\)/g,'$2 kilometres ($1 mi)'); h = h.replace(/([0-9.,]+–[0-9.,]+) feet \(([0-9.,]+–[0-9.,]+) m\)/g,'$2 metres ($1 ft)'); h = h.replace(/([0-9.,]+–[0-9.,]+) inches \(([0-9.,]+–[0-9.,]+) mm\)/g,'$2 millimetres ($1 in)'); h = h.replace(/([0-9.,]+)-mile \(([0-9.,]+) km\)/g,'$2-kilometre ($1 mi)'); h = h.replace(/([0-9.,]+)-mile \(([0-9.,]+)-km\)/g,'$2-kilometre ($1-mi)'); h = h.replace(/([0-9.,]+)-foot \(([0-9.,]+) m\)/g,'$2-metre ($1 ft)'); h = h.replace(/([0-9,.]+)-mile-long \(([0-9,.]+) km\)/g,'$2-kilometre-long ($1 mi)'); h = h.replace(/([0-9,.]+ acres) \(([0-9,.]+ ha)\)/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,.]+ 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 metres ($1 ft)'); h = h.replace(/([0-9,.]+ ft) \(([0-9,.]+ m)\)/g,'$2 ($1)'); h = h.replace(/([0-9,.]+) pounds \(([0-9,.]+) kg\)/g,'$2 kilograms ($1 lb)'); h = h.replace(/(−?[0-9,.]+) feet \((−?[0-9.,]+) m\)/g,'$2 metres ($1 ft)'); h = h.replace(/([0-9,.]+) per square mile \(([0-9,.]+)\/km²\)/g,'$2 per square kilometre ($1/sq mi)'); 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-metre ($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²\)/g,'$2 per square kilometre ($1/sq mi)'); h = h.replace(/([0-9,.]+) per square mile \(([0-9,.]+)\/km²\)/g,'$2 per square kilometre ($1/sq mi)'); h = h.replace(/([0-9,.]+) people per square mile \(([0-9,.]+)\/km 2<\/sup>\)/g,'$2 people per square kilometre ($1/sq mi)'); h = h.replace(/([0-9,.]+) inhabitants per square mile \(([0-9,.]+)\/km 2<\/sup>\)/g,'$2 inhabitants per square kilometre ($1/sq mi)'); h = h.replace(/([0-9,.]+) yards \(([0-9.,]+) m\)/g,'$2 metres ($1 yd)'); h = h.replace(/([0-9,.]+) yd \(([0-9.,]+) m\)/g,'$2 m ($1 yd)'); 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 kilometres ($1 sq mi)'); h = h.replace(/([0-9,.]+) square miles \(([0-9,.]+) km 2<\/sup>\)/g,'$2 square kilometres ($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 centimetres ($1 in)'); h = h.replace(/([0-9,.]+ in) \(([0-9,.]+ cm)\)/g,'$2 ($1)'); h = h.replace(/(−?[0-9,.]+) feet \((−?[0-9.,]+) m\)/g,'$2 metres ($1 ft)'); h = h.replace(/([0-9,.]+) inches \(([0-9,.]+) cm\)/g,'$2 centimetres ($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 millimetres ($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 millimetres ($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,.]+ )() 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,.]+)-foot-wide \(([0-9.,]+) m\)/g,'$2-metre-wide ($1 ft)'); h = h.replace(/([0-9,.]+) miles per hour \(([0-9.,]+) km\/h\)/g,'$2 kilometres per hour ($1 mph)'); h = h.replace(/([0-9,.]+) miles per hour \(([0-9.,]+) kilometers per hour\)/g,'$2 kilometres 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)'); txt.innerHTML = h;