Skip to content
Advertisement

Tag: language-agnostic

How to parse and capture any measurement unit

In my application, users can customize measurement units, so if they want to work in decimeters instead of inches or in full-turns instead of degrees, they can. However, I need a way to parse a string containing multiple values and units, such as 1′ 2″ 3/8. I’ve seen a few regular expressions on SO and didn’t find any which matched

Advertisement