I am trying to create a currency regex in jquery. Everything works fine except it includes numbers with a minus sign in the middle like “1-3”
I am using a match function with the following regex:
/[\$€£]\d{0,3},?\d{1,3}(.\d{2})?/g
Does anyone have any idea why the minus sign is being included?
Thanks for your help!
The minus sign is being included because you have a
.in the middle of your regex..indicates that it can match any character.