While developing jQuery plugin for upcoming bookmarking "Items in select boxes" plugin for our Vudu CMS

I wrote a simple regexp to strip few characters (pipe, minus, apostrof and white-space) that are added before the actual item.
function cleanOptionText(txt)
{
return txt.replace(/^[\s|'-]+/, '');
};
It worked just fine on FF9 and Chrome but in IE8 only the first pipe (|) was removed. After some debugging I discovered that I have both spaces and non-breaking spaces that should be removed and that in IE8 class shorthand \s (which should include all white space) doesn’t include non-breaking space.
Code for non-breaking space is 0xa0 (dec 160) so regexp should be updated as follows:
function cleanOptionText(txt)
{
return txt.replace(/^[\s\xA0|'-]+/, '');
};








