Hi John.

I know there is a fallback solution, but as the ID is auto-generated
in my app and it does adhere to
the standard w3c (except for a single character) wouldnt it be nice to
atleast include the minimum
characters allowed in the spec. I read the w3c spec:

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 (".").

as:

[A-Za-z][A-Za-Z0-9-_.:]*

as they define the definition of a letter to be [A-Za-z] ascii. Then,
if you use unicode letters, you should escape/use fallback.

Well - just my 2 cents...

Cheers, Lars Borup Jensen



On 26 Jan., 16:36, John Resig <jere...@gmail.com> wrote:
> 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_...
>
> --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
-~----------~----~----~----~------~----~------~--~---

Reply via email to