User:Ohconfucius/script/tometricunits.js: Difference between revisions

Content deleted Content added
false positive with "in"
bug fix
Line 14:
regex(/(?<![,\d\(\[])(\d*),?(\d+(?:\.\d+|))(?:(?:&nbsp;|\s|)(?:pounds|lbs?\.?)|)\s?([–—])\s?(\d*),?(\d+(?:\.\d+|))(?:&nbsp;|\s|)(?:pounds|lbs?\.?)/g, '{{convert|$1$2|to|$4$5|lb|kg}}');
 
regex(/(?<![,\d\(\[])(\d{1,2}(?:\.\d+|))(?:(?:&nbsp;|\s|)(?:inchesinch(?:es|)|in\.?)|)\s?(to|-)\s?(\d{1,2}(?:\.\d+|))(?:&nbsp;|\s|)(?:inchesinch(?:es|)|in)\.(?=[\.,;]?\s+[a-z\(])/g, '{{convert|$1|$2|$3|in|cm}}');
regex(/(?<![,\d\(\[])(\d{1,2}(?:\.\d+|))(?:(?:&nbsp;|\s|)(?:inchesinch(?:es|)|in\.?)|)\s?(to|-)\s?(\d{1,2}(?:\.\d+|))(?:&nbsp;|\s|)(?:inchesinch(?:es|)|in)(?=\.\s+[A-Z]|\s.\W|\n)/g, '{{convert|$1|$2|$3|in|cm}}');
regex(/(?<![,\d\(\[])(\d{1,2}(?:\.\d+|))(?:(?:&nbsp;|\s|)(?:inchesinch(?:es|)|in\.?)|)\s?([–—])\s?(\d{1,2}(?:\.\d+|))(?:&nbsp;|\s|)(?:inchesinch(?:es|)|in\.)/g, '{{convert|$1|$2|$3|in|cm}}');
 
regex(/(?<![,\d\(\[])(\d*),?(\d+(?:\.\d+|))(?:(?:&nbsp;|\s|)(?:feet|ft\.?)|)\s?(to|-)\s?(\d*),?(\d+(?:\.\d+|))(?:&nbsp;|\s|)(?:feet|ft)\.?(?=[\.,;]?\s+[a-z\(])/g, '{{convert|$1$2|$3|$4$5|ft|m}}');
Line 65:
regex(/(?<![,\d\(\[])(\d+),?(\d+(?:\.\d+|))(?:&nbsp;|\s|)acres?/g, '{{convert|$1$2|$3|km2}}');
 
regex(/(?<![,\d\(\[])(\d+(?:\.\d+|))(?:&nbsp;|\s|)acres?/g, '{{convert|$1$2|$3acreacre|ha}}');