Part of my project is to retrieve a string variable from an external source (google docs) and parse it. This string represents width and height.
I have no problem retrieving, I just need to parse it in to two strings.
The string has 4 variations.
Here are examples:
3"x4"
3"hx4"w
3hx4w
3x4
The width is always the first number and the height is always the second. Sometimes, the width and height have decimal points.
I’m a regex nube. If anyone can help me parse this into two strings of the numeric values only, I would be much obliged.
An English representation of the regex is basically
[\d.]is a character that is either a digit or a dot. The+means one or more.