On Sep 19, 4:34 am, Pluthos <[EMAIL PROTECTED]> wrote: > I would like to write something like > $(/(id.*name)/) to be able to capture id_A_name, id_B_name and > id_C_name, or some other convenient form of using *, ^ and $. > > Would regular expressions work as arguments to $() ? Is there any way > of doing this?
jQ doesn't (currently) support regexes as an argument to $(), but i believe you can get the effect you're looking for by using filter() in conjunction with regexes. Something along the lines of... $("E[id^='id_']").filter(...) http://docs.jquery.com/Traversing/filter#expr http://docs.jquery.com/Traversing/filter#fn Using the first form, i think you could probably get away with something like: $("E[id^='id_']").filter("[id$='_name']") (untested)