I have the following strings:
1: "AMETHYST 9.5x10.5 OVAL CHECKERBOARD AAA"
2: "AMETHYST 9x10 OVAL CHECKERBOARD AAA"
3: "AMETHYST 9-10 OVAL CHECKERBOARD AAA"
4: "AMETHYST 9.5-10.5 OVAL CHECKERBOARD AAA"
5: "AMETHYST 9.5 OVAL CHECKERBOARD AAA"
6: "AMETHYST 9 OVAL CHECKERBOARD AAA"
Per case I would like my regex to return an array of the integers or floats for example taking the first case:
[
[0] "9.5"
[1] "10.5"
]
After much trying on Rubular I came up with:
/\d+[.]\d+?/
This gives me most of the match results I need when checking on Rubular.com. However in the cases 2, 3, 6 it will not pickup on the integer in front of the - or x character, or when the int is alone like case 6.
What am I missing?
THANKS!