I'm having a heck of a time finding a regex that will pull dimensions from a string.
Here is what I have so far, its not really doing what I want:
((\d+\s*(\d+\d+|\d+)*)\s*[xX]\s*(\d+\s*(\d+\d+|\d+)*)\s*[xX]\s*(\d+\s*(\d+\d+|\d+)*)|(\d+\s*(\d+\d+|\d+)*)\s*[xX]\s*(\d+\s*(\d+\d+|\d+)*)| (\d+\s*(\d+\d+|\d+)*))
Here are some examples of what it pulls (bolded):
-16" x 1476' 80 GA. EQ Ultra-Premium Hand Wrap - Use as replacement for 18" x 1500' 80 Gauge (4/Case)
-48 x 60" Corrugated Sheet (250/Bale)
-MP Die Cut Divider 25 7/ 8 x 19 3/4 1000/bale
-Part "B" (3"x3x 1/2" charcoal foam) only - extra pieces
I'm looking for it grab do the following:
-16" x 1476' 80 GA. EQ Ultra-Premium Hand Wrap - Use as replacement for 18" x 1500' 80 Gauge (4/Case)
-48 x 60" Corrugated Sheet (250/Bale)
-MP Die Cut Divider 25 7/8 x 19 3/4 1000/bale
-Part "B" (3"x3 x 1/2" charcoal foam) only - extra pieces
Notice the regex is not catching the lower part of the fraction because of the "/", also if an inch symbol (i.e. ") is between that dimension and another number it won't grab the first number, you can see that in the first example.
Once I have this regex working, I can strip out the inch and foot symbols (i.e. " and '), and break each number down into each dimension. Just trying to pull the initial dimension numbers first.
Thanks so much if you have any input.