User:Thespaceface/CustomUnits/USMetric0.js

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

h = h.replace(/([0-9.,]+) kilometres \(([0-9.,]+) mi\)/g,'$1 kilometers'); h = h.replace(/([0-9.,]+–[0-9.,]+) kilometres \(([0-9.,]+–[0-9.,]+) mi\)/g,'$1 kilometers'); h = h.replace(/([0-9.,]+–[0-9.,]+) metres \(([0-9.,]+–[0-9.,]+) ft\)/g,'$1 meters'); h = h.replace(/([0-9.,]+–[0-9.,]+) millimetres \(([0-9.,]+–[0-9.,]+) in\)/g,'$1 millimeters'); h = h.replace(/([0-9.,]+)-kilometre \(([0-9.,]+) mi\)/g,'$1-kilometer'); h = h.replace(/([0-9.,]+)-kilometre \(([0-9.,]+)-mi\)/g,'$1-kilometer'); h = h.replace(/([0-9.,]+)-metre \(([0-9.,]+) ft\)/g,'$1-meter'); h = h.replace(/([0-9,.]+)-kilometre-long \(([0-9,.]+) mi\)/g,'$1-kilometer-long'); h = h.replace(/([0-9,.]+) metres \(([0-9.,]+) ft\)/g,'$1 meters'); h = h.replace(/([0-9,.]+ m) \(([0-9,.]+ ft)\)/g,'$1'); h = h.replace(/([0-9,.]+)-square-metre \(([0-9,.]+) sq ft\)/g,'$1-square-meter'); h = h.replace(/([0-9,.]+ m 2<\/sup>) \(([0-9,.]+ sq ft)\)/g,'$1'); h = h.replace(/([0-9,.]+ sq ft) \(([0-9,.]+ m 2<\/sup>)\)/g,'$1'); h = h.replace(/([0-9,.]+) per square kilometre \(([0-9,.]+)\/sq mi\)/g,'$1 per square kilometer'); h = h.replace(/([0-9,.]+) people per square kilometre \(([0-9,.]+)\/sq mi\)/g,'$1 people per square kilometer'); h = h.replace(/([0-9,.−-]+ °C) \(([0-9,.−-]+ °F)\)/g,'$1'); h = h.replace(/([0-9,.−-]+ °C) \(([0-9,.−-]+ °F)\)/g,'$1'); h = h.replace(/([0-9,.−-]+ C) \(([0-9,.−-]+ F)\)/g,'$1'); h = h.replace(/([0-9,.−-]+ C) \(([0-9,.−-]+ F)\)/g,'$1'); h = h.replace(/([0-9,.]+ km) \(([0-9,.]+ mi)\)/g,'$1'); h = h.replace(/([0-9,.]+ km 2<\/sup>) \(([0-9,.]+ sq mi)\)/g,'$1'); h = h.replace(/([0-9,.]+) square kilometres \(([0-9,.]+) sq mi\)/g,'$1 square kilometrer'); h = h.replace(/([0-9,.]+) square kilometres \(([0-9,.]+) sq mi\)/g,'$1 square kilometers');

h = h.replace(/([0-9,.]+ km²) \(([0-9,.]+ sq mi)\)/g,'$1'); h = h.replace(/([0-9,.]+ km) \(([0-9,.]+ mi)\)/g,'$1'); h = h.replace(/([0-9,.]+) kilograms \(([0-9,.]+) lb\)/g,'$1 kilograms'); h = h.replace(/([0-9,.]+) kg \(([0-9,.]+) lb\)/g,'$1 kg'); h = h.replace(/([0-9,.]+ cm) \(([0-9,.]+ in)\)/g,'$1'); h = h.replace(/([0-9,.]+) centimetres \(([0-9,.]+) in\)/g,'$1 cm'); h = h.replace(/([0-9,.]+ cm) \(([0-9,.]+ in)\)/g,'$1'); h = h.replace(/([0-9,.]+) centimetres \(([0-9,.]+) in\)/g,'$1 centimeters'); h = h.replace(/([0-9,.]+ mm) \(([0-9,.]+ in)\)/g,'$1'); h = h.replace(/([0-9,.]+) millimetres \(([0-9,.]+) in\)/g,'$1 millimeters'); h = h.replace(/([0-9,.]+ mm) \(([0-9,.]+ in)\)/g,'$1'); h = h.replace(/([0-9,.]+) millimetres \(([0-9,.]+) mm\)/g,'$2 millimeters'); h = h.replace(/([0-9,.]+ m) \(([0-9,.]+ ft)\)/g,'$1'); h = h.replace(/([0-9,.]+\/km 2<\/sup>) \(([0-9,.]+\/ sq mi)\)/g,'$1'); h = h.replace(/([0-9,.]+\/km²) \(([0-9,.]+\/ sq mi)\)/g,'$1'); h = h.replace(/([0-9,.]+ km)() \(([0-9.,]+ mi)\)/g,'$1$2'); h = h.replace(/([0-9,.]+)-metre-wide \(([0-9.,]+) ft\)/g,'$1-meter-wide'); h = h.replace(/([0-9,.]+) kilometres per hour \(([0-9.,]+) mph\)/g,'$1 kilometers per hour'); h = h.replace(/([0-9,.]+) kilometres per hour \(([0-9.,]+) miles per hour\)/g,'$1 kilometers per hour'); h = h.replace(/([0-9,.]+) km\/h \(([0-9.,]+) mph\)/g,'$1 km/h'); h = h.replace(/([0-9,.]+) km\/h \(([0-9.,]+) mph\)/g,'$1 km/h'); h = h.replace(/([0-9,.]+) km\/h \(([0-9.,]+) mph\)/g,'$1 km/h');

txt.innerHTML = h;