I am trying to match a particular set of strings with a regex
1- #1 – .75 Gallon $16.99
2- #2 –1.6 Gallon $36.99
This is what I tried to figure out with many attempts but still it doesn't seems to work
console.log(/^#\d\s+–\s+[0-9]*\.[0-9]+\s+[a-zA-Z]+\s+:[0-9]*\.[0-9]+$/.test('#2 – 1.6 Gallon $36.99'))
console.log(/^#\d\s+–\s+[0-9]*\.[0-9]+\s+[a-zA-Z]+\s+:[0-9]*\.[0-9]+$/.test('#1 – .75 Gallon $16.99'))
I have gone through each part individually but I don't know where I am making mistake ,any help would be really appreciated. Thanks