The simplest and fastest rx-es that work are /^[\s\xA0]+/ and /[\s\xA0]+$/
(thanks travis.hardiman)
jquery-1.4.1.js (arround line#3859 ) has : rleadingWhitespace = /^\s+/,
which is perhaps a bug because IE does not cover \u00A0, as a white-space
If I may suggest, introduction of :
- rleadingWhitespace = /^[\s\xA0]+/,
- rtrailingWhitespace = /[\s\xA0]+$ ,
somewhere at the top of jQuery enclosure, where all the jQuery wide, var's are declared.
to be used wherever required/needed.
This is also good for new jQuery.trim() proposed, which will be using them both if host does not support "".trim()
--DBJ