Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations bkrike on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

RegExp under IE on the Mac

Status
Not open for further replies.

andersonjb

Programmer
Apr 17, 2003
4
US
This JavaScript RegExp works on IE and Netscape on Windows, and on Netscape on the Mac, but not on IE on the Mac. It fails when trying to match the pattern.

function stripZeros(userId)
{
var pattern = new RegExp(/^([0\s]+)/);

if (userId.match(pattern) != null)
{
var stuffToStrip = userId.match(pattern);
userId = userId.substring(stuffToStrip[0].length, userId.length);
}
return userId;
}
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top