Community Patterns

Community Library Entry

0

Regular Expression
Created·2017-02-17 19:09
Flavor·PCRE (Legacy)

/
(?P<amount>-?\d+(?:\.\d*)?)[^\S\n]*(?P<degrees>°|deg(?:rees?)?|in)?[^\S\n]*(?P<unit>c(?:(?=el[cs]ius\b|entigrades?\b|\b))|f(?:(?=ahrenheit\b|\b))|k(?:(?=elvins?\b|\b)))
/
gi
Open regex in editor

Description

Matches common types of English-written temperature units.

Submitted by anonymous