User:Thespaceface/CustomUnits/Imperial1.js

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