KnowledgeHub
Questions
Tags
Users
Search
Alex Rivera
|
Logout
Edit Question
Title
Body
I have a series of text that contains mixed numbers (ie: a whole part and a fractional part). The problem is that the text is full of human-coded sloppiness: The whole part may or may not exist (ex: "10") The fractional part may or may not exist (ex: "1/3") The two parts may be separated by spaces and/or a hyphens (ex: "10 1/3", "10-1/3", "10 - 1/3"). The fraction itself may or may not have spaces between the number and the slash (ex: "1 /3", "1/ 3", "1 / 3"). There may be other text after the fraction that needs to be ignored I need a regex that can parse these elements so that I can create a proper number out of this mess.
Tags (comma-separated)
Save Edits
Cancel