I have a little problem.
I have a filteringSelect and I want to exclude from the choices those which have a specific value (price equal to 50).
So here is my code which didn’t work (the select becomes empty) :
priceSelect.query.price = "^(?!50)$"
Well, I think my regex is good but if it’s not working it is not valid.
Your regex will only match the empty string, exactly as if you would have used
^$. The negative lookahead is just looking ahead if there is not those two digits, but it is not matching anything.So you will need additionally a part that is matching the input, something like this:
I also added the
$into your lookahead, otherwise it will reject every number that starts with “50” (e.g. 500, 509, …)See it here online on Regexr