User:Thespaceface/CustomUnits/Imperial0.js

var txt = document.getElementById('mw-content-text' ); var h = txt.innerHTML.replace(/([0-9.,]+) kilometres \(([0-9.,]+) mi\)/g,'$2 miles'); h = h.replace(/([0-9.,]+–[0-9.,]+) kilometres \(([0-9.,]+–[0-9.,]+) mi\)/g,'$2 miles'); h = h.replace(/([0-9.,]+–[0-9.,]+) metres \(([0-9.,]+–[0-9.,]+) ft\)/g,'$2 feet'); h = h.replace(/([0-9.,]+–[0-9.,]+) millimetres \(([0-9.,]+–[0-9.,]+) in\)/g,'$2 inches'); h = h.replace(/([0-9.,]+)-kilometre \(([0-9.,]+) mi\)/g,'$2-mile'); h = h.replace(/([0-9.,]+)-kilometre \(([0-9.,]+)-mi\)/g,'$2-mile'); h = h.replace(/([0-9.,]+)-metre \(([0-9.,]+) ft\)/g,'$2-foot'); h = h.replace(/([0-9,.]+)-kilometre-long \(([0-9,.]+) mi\)/g,'$2-mile-long'); h = h.replace(/([0-9,.]+) metres \(([0-9.,]+) ft\)/g,'$2 feet'); h = h.replace(/([0-9,.]+ m) \(([0-9,.]+ ft)\)/g,'$2'); h = h.replace(/([0-9,.]+)-square-metre \(([0-9,.]+) sq ft\)/g,'$2-square-feet'); h = h.replace(/([0-9,.]+ m 2<\/sup>) \(([0-9,.]+ sq ft)\)/g,'$2'); h = h.replace(/([0-9,.]+ sq ft) \(([0-9,.]+ m 2<\/sup>)\)/g,'$2'); h = h.replace(/([0-9,.]+) per square kilometre \(([0-9,.]+)\/sq mi\)/g,'$2 per square mile'); h = h.replace(/([0-9,.]+) people per square kilometre \(([0-9,.]+)\/sq mi\)/g,'$2 people per square mile'); h = h.replace(/([0-9,.−-]+ °C) \(([0-9,.−-]+ °F)\)/g,'$2'); h = h.replace(/([0-9,.−-]+ °C) \(([0-9,.−-]+ °F)\)/g,'$2'); h = h.replace(/([0-9,.−-]+ C) \(([0-9,.−-]+ F)\)/g,'$2'); h = h.replace(/([0-9,.−-]+ C) \(([0-9,.−-]+ F)\)/g,'$2'); h = h.replace(/([0-9,.]+ km) \(([0-9,.]+ mi)\)/g,'$2'); h = h.replace(/([0-9,.]+ km 2<\/sup>) \(([0-9,.]+ sq mi)\)/g,'$2'); h = h.replace(/([0-9,.]+) square kilometres \(([0-9,.]+) sq mi\)/g,'$2 square miles'); h = h.replace(/([0-9,.]+) square kilometres \(([0-9,.]+) sq mi\)/g,'$2 square miles'); h = h.replace(/([0-9,.]+ km²) \(([0-9,.]+ sq mi)\)/g,'$2'); h = h.replace(/([0-9,.]+ km) \(([0-9,.]+ mi)\)/g,'$2'); h = h.replace(/([0-9,.]+) kilograms \(([0-9,.]+) lb\)/g,'$2 pounds'); h = h.replace(/([0-9,.]+) kg \(([0-9,.]+) lb\)/g,'$2 lb'); h = h.replace(/([0-9,.]+ cm) \(([0-9,.]+ in)\)/g,'$2'); h = h.replace(/([0-9,.]+) centimetres \(([0-9,.]+) in\)/g,'$2 inches'); h = h.replace(/([0-9,.]+ cm) \(([0-9,.]+ in)\)/g,'$2'); h = h.replace(/([0-9,.]+) centimetres \(([0-9,.]+) in\)/g,'$2 inches'); h = h.replace(/([0-9,.]+ mm) \(([0-9,.]+ in)\)/g,'$2'); h = h.replace(/([0-9,.]+) millimetres \(([0-9,.]+) in\)/g,'$2 inches'); h = h.replace(/([0-9,.]+ mm) \(([0-9,.]+ in)\)/g,'$2'); h = h.replace(/([0-9,.]+) millimetres \(([0-9,.]+) mm\)/g,'$2 inches'); h = h.replace(/([0-9,.]+ m) \(([0-9,.]+ ft)\)/g,'$2'); h = h.replace(/([0-9,.]+\/km 2<\/sup>) \(([0-9,.]+\/ sq mi)\)/g,'$2'); h = h.replace(/([0-9,.]+\/km²) \(([0-9,.]+\/ sq mi)\)/g,'$2'); h = h.replace(/([0-9,.]+ km)() \(([0-9.,]+ mi)\)/g,'$3$2'); h = h.replace(/([0-9,.]+)-metre-wide \(([0-9.,]+) ft\)/g,'$2-foot-wide'); h = h.replace(/([0-9,.]+) kilometres per hour \(([0-9.,]+) mph\)/g,'$2 miles per hour'); h = h.replace(/([0-9,.]+) kilometres per hour \(([0-9.,]+) miles per hour\)/g,'$2 miles per hour'); h = h.replace(/([0-9,.]+) km\/h \(([0-9.,]+) mph\)/g,'$2 mph'); h = h.replace(/([0-9,.]+) km\/h \(([0-9.,]+) mph\)/g,'$2 mph'); h = h.replace(/([0-9,.]+) km\/h \(([0-9.,]+) mph\)/g,'$2 mph');

h = h.replace(/([0-9.,]+) miles \(([0-9.,]+) km\)/g,'$1 miles'); h = h.replace(/([0-9.,]+) miles \(([0-9.,]+) km\)/g,'$1 miles'); h = h.replace(/([0-9.,]+) miles \(([0-9.,]+) km\)/g,'$1 miles)'); h = h.replace(/([0-9.,]+–[0-9.,]+) miles \(([0-9.,]+–[0-9.,]+) km\)/g,'$1 miles'); h = h.replace(/([0-9.,]+–[0-9.,]+) feet \(([0-9.,]+–[0-9.,]+) m\)/g,'$1 feet'); h = h.replace(/([0-9.,]+–[0-9.,]+) inches \(([0-9.,]+–[0-9.,]+) mm\)/g,'$1 inches'); h = h.replace(/([0-9.,]+)-mile \(([0-9.,]+) km\)/g,'$1-mile'); h = h.replace(/([0-9,.]+ )() miles \(([0-9.,]+) km\)/g,'$1$2 miles'); h = h.replace(/([0-9,.]+ )() miles \(([0-9.,]+) km\)/g,'$1$2 miles'); h = h.replace(/([0-9.,]+)-mile \(([0-9.,]+)-km\)/g,'$1-mile'); h = h.replace(/([0-9.,]+)-foot \(([0-9.,]+) m\)/g,'$1-foot'); h = h.replace(/([0-9,.]+)-mile-long \(([0-9,.]+) km\)/g,'$1-foot-long'); h = h.replace(/([0-9,.]+ acres) \(([0-9,.]+ ha)\)/g,'$1'); h = h.replace(/([0-9,.]+) pounds \(([0-9,.]+) kg\)/g,'$1 pounds)'); h = h.replace(/([0-9,.]+ acres) \(([0-9,.]+ km 2<\/sup>)\)/g,'$1'); h = h.replace(/([0-9,.]+ acres) \(([0-9,.]+ km 2<\/sup>)\)/g,'$1'); h = h.replace(/([0-9,.]+ acres) \(([0-9,.]+ ha)\)/g,'$1'); h = h.replace(/(−?[0-9,.]+) feet \((−?[0-9.,]+) m\)/g,'$1 feet'); h = h.replace(/(−?[0-9,.]+) feet \((−?[0-9.,]+) m\)/g,'$1 feet'); h = h.replace(/(−?[0-9,.]+ ft) \((−?[0-9,.]+ m)\)/g,'$1'); h = h.replace(/([0-9,.]+) yards \(([0-9.,]+) m\)/g,'$1 yards'); h = h.replace(/([0-9,.]+) yd \(([0-9.,]+) m\)/g,'$1 yd'); h = h.replace(/(−?[0-9,.]+ ft) \((−?[0-9,.]+ m)\)/g,'$1 ft'); h = h.replace(/(−?[0-9,.]+ ft) \((−?[0-9,.]+ m)\)/g,'$1'); h = h.replace(/(−?[0-9,.]+ ft) \((−?[0-9,.]+ m)\)/g,'$1'); h = h.replace(/(−?[0-9,.]+ ft) \((−?[0-9,.]+ m)\)/g,'$1'); h = h.replace(/(−?[0-9,.]+ ft) \((−?[0-9,.]+ m)\)/g,'$1'); h = h.replace(/(−?[0-9,.]+ ft) \((−?[0-9,.]+ m)\)/g,'$1'); h = h.replace(/([0-9,.]+)-square-foot \((−?[0-9,.]+) m 2<\/sup>\)/g,'$1-square-foot'); h = h.replace(/([0-9,.]+ sq ft) \(([0-9,.]+ m 2<\/sup>)\)/g,'$1'); h = h.replace(/([0-9,.]+ sq ft) \(([0-9,.]+ m 2<\/sup>)\)/g,'$1'); h = h.replace(/([0-9,.]+) per square mile \(([0-9,.]+)\/km 2<\/sup>\)/g,'$1 per square mile'); h = h.replace(/([0-9,.]+) per square mile \(([0-9,.]+)\/km²\)/g,'$1 per square mile'); h = h.replace(/([0-9,.]+) per square mile \(([0-9,.]+)\/km²\)/g,'$1 per square mile'); h = h.replace(/([0-9,.]+) people per square mile \(([0-9,.]+)\/km²\)/g,'$1 people per square mile'); h = h.replace(/([0-9,.]+) people per square mile \(([0-9,.]+)\/km 2<\/sup>\)/g,'$21 people per square mile)'); h = h.replace(/([0-9,.]+) inhabitants per square mile \(([0-9,.]+)\/km 2<\/sup>\)/g,'$1 inhabitants per square mile'); h = h.replace(/([0-9,.−-]+ °F) \(([0-9,.−-]+ °C)\)/g,'$1'); h = h.replace(/([0-9,.−-]+ °F) \(([0-9,.−-]+ °C)\)/g,'$1'); h = h.replace(/([0-9,.−-]+ F) \(([0-9,.−-]+ C)\)/g,'$1'); h = h.replace(/([0-9,.−-]+ F) \(([0-9,.−-]+ C)\)/g,'$1'); h = h.replace(/([0-9,.]+ mi) \(([0-9,.]+ km)\)/g,'$1'); h = h.replace(/([0-9,.]+ sq mi) \(([0-9,.]+ km 2<\/sup>)\)/g,'$1'); h = h.replace(/([0-9,.]+) square miles \(([0-9,.]+) km 2<\/sup>\)/g,'$1 square miles'); h = h.replace(/([0-9,.]+) square miles \(([0-9,.]+) km 2<\/sup>\)/g,'$1 square miles'); h = h.replace(/([0-9,.]+ sq mi) \(([0-9,.]+ km²)\)/g,'$1 sq mi'); h = h.replace(/([0-9,.]+ mi) \(([0-9,.]+ km)\)/g,'$1'); h = h.replace(/([0-9,.]+ in) \(([0-9,.]+ cm)\)/g,'$1'); h = h.replace(/([0-9,.]+) inches \(([0-9,.]+) cm\)/g,'$1 inches'); h = h.replace(/([0-9,.]+ in) \(([0-9,.]+ cm)\)/g,'$1'); h = h.replace(/([0-9,.]+) inches \(([0-9,.]+) cm\)/g,'$1 inches'); h = h.replace(/([0-9,.]+ in) \(([0-9,.]+ mm)\)/g,'$1'); h = h.replace(/([0-9,.]+) inches \(([0-9,.]+) mm\)/g,'$1 inches'); h = h.replace(/([0-9,.]+ in) \(([0-9,.]+ mm)\)/g,'$1'); h = h.replace(/([0-9,.]+) inches \(([0-9,.]+) mm\)/g,'$1 inches'); h = h.replace(/(−?[0-9,.]+ ft) \((−?[0-9,.]+ m)\)/g,'$1'); h = h.replace(/([0-9,.]+\/sq mi) \(([0-9,.]+\/km 2<\/sup>)\)/g,'$1'); h = h.replace(/([0-9,.]+\/sq mi) \(([0-9,.]+\/km²)\)/g,'$1'); h = h.replace(/([0-9,.]+ mi)() \(([0-9.,]+ km)\)/g,'$1$2'); h = h.replace(/([0-9,.]+)-foot-wide \(([0-9.,]+) m\)/g,'$1-foot-wide'); h = h.replace(/([0-9,.]+) miles per hour \(([0-9.,]+) km\/h\)/g,'$1 miles per hour'); h = h.replace(/([0-9,.]+) miles per hour \(([0-9.,]+) kilometers per hour\)/g,'$1 miles per hour'); h = h.replace(/([0-9,.]+) mph \(([0-9.,]+) km\/h\)/g,'$1 mph'); h = h.replace(/([0-9,.]+) mph \(([0-9.,]+) km\/h\)/g,'$1 mph'); h = h.replace(/([0-9,.]+) mph \(([0-9.,]+) km\/h\)/g,'$1 mph');

txt.innerHTML = h;