quickExpr invalid w3c ID/NAME regexp

quickExpr invalid w3c ID/NAME regexp


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