I've got several input boxes like so:
<input type="checkbox" name="checkbox_item[500]" /> <input type="checkbox" name="checkbox_item[10]" /> <input type="checkbox" name="checkbox_item[2]" /> <input type="checkbox" name="checkbox_item[1]" /> <input type="checkbox" name="checkbox_item[]" /> So I'm using the following regex pattern checkbox_item\[\d+\] which works nicely in my regex tester but I cannot get it to work with Jquery. This is my Jquery code:
console.log($("input:regex(name, /checkbox_item\[\d+\]/)").length); I was expecting 4 but instead got 28!
Can somebody shed any light on this?
Thanks
/before and after regular expression in the selector, i.e.:regex(name, checkbox_item\[\d+\]).