Created
February 8, 2018 17:06
-
-
Save cpgillem/5b6fcc228f7a98ab84d3274fa4f2b04e to your computer and use it in GitHub Desktop.
Cursed regex for identifying the parts of imperial unit strings that match the format [x' y"] or [y"]
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| ^(?:(?<fq>-?\d+)\s*(?<fu>\'|f(?:ee)?t\.?))?\s*(?<iq>(?:\d+\s+)?\d+\/\d+|\d*\.\d+|\d+)\s*(?<iu>\"|''|in(?:ches|\.?))$ |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment