I'm trying to match the following possibilities with a regex:
MORE THAN CAD 10,000
MORE THAN CAD 10,000 BUT LESS THAN CAD 15,000
LESS THAN CAD 10,000
My regex works with /^(((MORE|LESS) THAN CAD [\d,]+)|(MORE THAN CAD [\d,]+ BUT LESS THAN CAD [\d,]+))$/ but I'm wondering if there's a more elegant way.
I've tried /^(MORE THAN CAD [\d,]+)?(( BUT )?LESS THAN CAD [\d,]+)?$/ but it's letting the following pass as well:
MORE THAN CAD 10,000LESS THAN CAD 15,000