I'm trying to get a regex that pulls out the format from a string.
Take this example, "5x7 (+$50)" or "20x24 (+70)". Is there any easier way to pull out the ##x## or #x#?
Here's the current code example....As you'll see the substring doesn't necessarily work for all test cases.
var example = "5x7 ($50)";
var ex_arr = example.split("x");
console.log(ex_arr[0]);
console.log(ex_arr[1].substring(0, 2));
.match(/(\d+)x(\d+)/)ex_arr[1].split(/\s/).shift()