User:SophieHuman/MetricOnly.js

for(var i = 0;i < 100; i++){ var b = document.getElementById("content-collabsible-block-" + i); if(b === null || b === undefined){ break; }	// b.click; // b.className+=" open-block"; // b.previousSibling.className+=" open-block"; b.removeAttribute("hidden"); } var txt = document.getElementById('mw-content-text' ); var h = txt.innerHTML.replace(/([0-9.,]+) kilometres \(([0-9.,]+) mi\)/g,'$1 kilometres'); h = h.replace(/([0-9.,]+–[0-9.,]+) kilometres \(([0-9.,]+–[0-9.,]+) mi\)/g,'$1 kilometres'); h = h.replace(/([0-9.,]+–[0-9.,]+) metres \(([0-9.,]+–[0-9.,]+) ft\)/g,'$1 metres'); h = h.replace(/([0-9.,]+–[0-9.,]+) millimetres \(([0-9.,]+–[0-9.,]+) in\)/g,'$1 millimetres'); h = h.replace(/([0-9.,]+)-kilometre \(([0-9.,]+) mi\)/g,'$1-kilometre'); h = h.replace(/([0-9.,]+)-kilometre \(([0-9.,]+)-mi\)/g,'$1-kilometre'); h = h.replace(/([0-9.,]+)-metre \(([0-9.,]+) ft\)/g,'$1-metre'); h = h.replace(/([0-9,.]+)-kilometre-long \(([0-9,.]+) mi\)/g,'$1-kilometre-long'); h = h.replace(/([0-9,.]+) metres \(([0-9.,]+) ft\)/g,'$1 metres'); h = h.replace(/([0-9.,]+) kilometers \(([0-9.,]+) mi\)/g,'$1 kilometers'); h = h.replace(/([0-9.,]+–[0-9.,]+) kilometers \(([0-9.,]+–[0-9.,]+) mi\)/g,'$1 kilometers'); h = h.replace(/([0-9.,]+–[0-9.,]+) meters \(([0-9.,]+–[0-9.,]+) ft\)/g,'$1 meters'); h = h.replace(/([0-9.,]+–[0-9.,]+) millimeters \(([0-9.,]+–[0-9.,]+) in\)/g,'$1 millimeters'); h = h.replace(/([0-9.,]+)-kilometer \(([0-9.,]+) mi\)/g,'$1-kilometer'); h = h.replace(/([0-9.,]+)-kilometer \(([0-9.,]+)-mi\)/g,'$1-kilometer'); h = h.replace(/([0-9.,]+)-meter \(([0-9.,]+) ft\)/g,'$1-meter'); h = h.replace(/([0-9,.]+)-kilometer-long \(([0-9,.]+) mi\)/g,'$1-kilometer-long'); h = h.replace(/([0-9,.]+) meters \(([0-9.,]+) ft\)/g,'$1 meters'); h = h.replace(/([0-9,.−-]+ m) \(([0-9,.−-]+ ft)\)/g,'$1'); h = h.replace(/([0-9,.−-]+ m) \(([0-9,.−-]+ ft)\)/g,'$1'); 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-metre'); h = h.replace(/([0-9,.]+)-square-meter \(([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,'$2 ($1)'); h = h.replace(/([0-9,.]+) per square kilometre \(([0-9,.]+)\/sq mi\)/g,'$1 per square kilometre'); h = h.replace(/([0-9,.]+) people per square kilometre \(([0-9,.]+)\/sq mi\)/g,'$1 people per square kilometre'); h = h.replace(/([0-9,.]+) per square kilometer \(([0-9,.]+)\/sq mi\)/g,'$1 per square kilometer'); h = h.replace(/([0-9,.]+) people per square kilometer \(([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,.]+ million km 2<\/sup>) \(([0-9,.]+ million sq mi)\)/g,'$1'); h = h.replace(/([0-9,.]+) square kilometres \(([0-9,.]+) sq mi\)/g,'$1 square kilometres'); h = h.replace(/([0-9,.]+) square kilometres \(([0-9,.]+) sq mi\)/g,'$1 square kilometres'); h = h.replace(/([0-9,.]+) square kilometers \(([0-9,.]+) sq mi\)/g,'$1 square kilometers'); h = h.replace(/([0-9,.]+) square kilometers \(([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,.]+ km) \(([0-9,.]+ mile)\)/g,'$1'); h = h.replace(/([0-9,.]+ km) \(([0-9,.]+ mile)\)/g,'$1');

h = h.replace(/([0-9,.]+) grams \(([0-9,.]+) oz\)/g,'$1 grams'); h = h.replace(/([0-9,.]+) g \(([0-9,.]+) oz\)/g,'$1 g'); h = h.replace(/([0-9,.]+) grams \(([0-9,.]+) gr\)/g,'$1 grams'); h = h.replace(/([0-9,.]+) g \(([0-9,.]+) gr\)/g,'$1 g'); h = h.replace(/([0-9,.]+) grams \(([0-9,.]+) oz\)/g,'$1 grams'); h = h.replace(/([0-9,.]+) g \(([0-9,.]+) oz\)/g,'$1 g'); h = h.replace(/([0-9,.]+) grams \(([0-9,.]+) gr\)/g,'$1 grams'); h = h.replace(/([0-9,.]+) g \(([0-9,.]+) gr\)/g,'$1 g');

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 centimetres'); h = h.replace(/([0-9,.]+) centimeters \(([0-9,.]+) in\)/g,'$1 centimeters'); h = h.replace(/([0-9,.]+ cm) \(([0-9,.]+ in)\)/g,'$1'); h = h.replace(/([0-9,.]+) centimetres \(([0-9,.]+) in\)/g,'$1 centimetres'); h = h.replace(/([0-9,.]+) centimeters \(([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 millimetres'); h = h.replace(/([0-9,.]+) millimeters \(([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,'$1 millimetres'); h = h.replace(/([0-9,.]+) millimeters \(([0-9,.]+) mm\)/g,'$1 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-metre-wide'); h = h.replace(/([0-9,.]+) kilometres per hour \(([0-9.,]+) mph\)/g,'$1 kilometres per hour'); h = h.replace(/([0-9,.]+) kilometres per hour \(([0-9.,]+) miles per hour\)/g,'$1 kilometres per hour'); h = h.replace(/([0-9,.]+)-meter-wide \(([0-9.,]+) ft\)/g,'$1-meter-wide'); h = h.replace(/([0-9,.]+) kilometers per hour \(([0-9.,]+) mph\)/g,'$1 kilometers per hour'); h = h.replace(/([0-9,.]+) kilometers 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'); h = h.replace(/([0-9,.–−-]+) mm\/a \(([0-9.,–−-]+) in\/year\)/g,'$1 mm/a'); h = h.replace(/([0-9,.]+) metres \(([0-9.,]+) feet\)/g,'$1 metres'); h = h.replace(/([0-9,.]+) metres or ([0-9.,]+) feet/g,'$1 metres'); h = h.replace(/([0-9,.]+) meters \(([0-9.,]+) feet\)/g,'$1 meters'); h = h.replace(/([0-9,.]+) meters or ([0-9.,]+) feet/g,'$1 meters'); h = h.replace(/([0-9,.]+) metres \(([0-9.,]+) feet\)/g,'$1 metres'); h = h.replace(/([0-9,.]+) metres or ([0-9.,]+) feet/g,'$1 metres'); h = h.replace(/([0-9,.]+) meters \(([0-9.,]+) feet\)/g,'$1 meters'); h = h.replace(/([0-9,.]+) meters or ([0-9.,]+) feet/g,'$1 meters'); h = h.replace(/([0-9,.]+) km or ([0-9.,]+) miles/g,'$1 km'); h = h.replace(/([0-9,.]+) km or ([0-9.,]+) mi/g,'$1 km'); h = h.replace(/([0-9,.–−-]+) m \(([0-9.,–−-]+) in\)/g,'$1 m'); h = h.replace(/([0-9,.]+) kilometres or ([0-9.,]+) miles/g,'$1 kilometres'); h = h.replace(/([0-9,.]+) kilometers or ([0-9.,]+) miles/g,'$1 kilometers'); h = h.replace(/([0-9,.]+) km or ([0-9.,]+) miles/g,'$1 km'); h = h.replace(/([0-9,.]+) km or ([0-9.,]+) mi/g,'$1 km'); h = h.replace(/([0-9,.]+) kilometres or ([0-9.,]+) miles/g,'$1 kilometres'); h = h.replace(/([0-9,.]+) kilometers or ([0-9.,]+) miles/g,'$1 kilometers'); h = h.replace(/([0-9.,]+–[0-9.,]+) kilometres \(([0-9.,]+–[0-9.,]+) miles\)/g,'$1 kilometres'); h = h.replace(/([0-9.,]+–[0-9.,]+) kilometers \(([0-9.,]+–[0-9.,]+) miles\)/g,'$1 kilometers'); h = h.replace(/([0-9.,]+–[0-9.,]+) kilometres \(([0-9.,]+–[0-9.,]+) miles\)/g,'$1 kilometres'); h = h.replace(/([0-9.,]+–[0-9.,]+) kilometers \(([0-9.,]+–[0-9.,]+) miles\)/g,'$1 kilometers');

txt.innerHTML = h;