var itm = '100,000,000 this is not a number' var startTime = new Date() for (var i = 0; i < 100000; i++) { // method 1 // if (itm.match(/^[+-]?[\d,]+(\.[\d,]*)?([eE][+-]?[\d,]+)?\%?$/) || itm.match(/^[+-]?\.[\d,]+([eE][+-]?[\d,]+)?\%?$/) || itm.match(/^0x[\da-f]+$/i)) // var three = 2 + 1 // method 2 if (itm.match(/^[+-]?[\d,]+(?:\.[\d,]*)?(?:[eE][+-]?[\d,]+)?\%?$/) || itm.match(/^[+-]?\.[\d,]+(?:[eE][+-]?[\d,]+)?\%?$/) || itm.match(/^0x[\da-f]+$/i)) var three = 2 + 1 //method 3 // if (itm.match(/^[+-]?(?:\d{1,3}(?:\,\d{3})*)*\.?\d*(?:[eE][+-]?\d+(?:\,\d{3})*)?[%\u00b0\u00bc\u00bd\u00be]?$/) && !itm.match(/^[eE]/)) // var three = 2 + 1 } var endTime = new Date() //replace "WScript.echo" with "alert" or whatever you need to display the results WScript.echo(endTime - startTime)