Actually, it would need to be a LOT more complicated than that (since it would, also, need to include unicode characters). Note that failing that regular expression is not enough for a complete failure - it simply doesn't stick on the "fast track" that's in jQuery(...) - it falls back to the selector engine.
My guess is that you're going to have to escape some characters: http://docs.jquery.com/Frequently_Asked_Questions#How_do_I_select_an_element_that_has_weird_characters_in_its_ID.3F --John On Mon, Jan 26, 2009 at 4:00 AM, Lars Borup Jensen <lbor...@gmail.com> wrote: > > Hi, > > I'm using jQuery in a BEA 8 Portal solution (yeah - I know its quite > old), but jQuery fails to handle the rather weird looking ID's > generated by the BEA Portal. At first I thought it was a bug in the > portal software, but it turns out its both BEA and jQuery which fails. > > Current jQuery (1.3.1) quickExp : /^[^<]*(<(.|\s)+>)[^>]*$|^#([\w-]+) > $/, > > But as stated by the W3C docs: > > http://www.w3.org/TR/REC-html40/types.html#type-name > > <quote> > ID and NAME tokens must begin with a letter ([A-Za-z]) and may be > followed by any number of letters, digits ([0-9]), hyphens ("-"), > underscores ("_"), colons (":"), and periods ("."). > </quote> > > So I have changed the quickExp to be: > > quickExpr=/^[^<]*(<(.|\s)+>)[^>]*$|^#([\w-_\.]+)$/, > > which actual is not QUITE accurate as it should be something like > > quickExpr=/^[^<]*(<(.|\s)+>)[^>]*$|^#([a-zA-Z][\w-_\.\:]+)$/, > > Cheers, Lars Borup Jensen > > > > --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "jQuery Development" group. To post to this group, send email to jquery-dev@googlegroups.com To unsubscribe from this group, send email to jquery-dev+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/jquery-dev?hl=en -~----------~----~----~----~------~----~------~--~---