test vs match strings only (v2)

Revision 2 of this benchmark created on


Setup

var numbersRegex = /^\d+$/
    var noWhiteSpaceRegex = /^\S*$/
    var positveIntegerRegex = /^[0-9]\d*$/
    var strRegex = /abc/;
    
    var number = "234524543";
    var white = "545mmckdddjl..21][a/z''";
    var str = "namebabcc"
    
    var x = 0;

Test runner

Ready to run.

Testing in
TestOps/sec
test
if (strRegex.test(str)) x++;
ready
match
if (str.match(strRegex)) x++;
 
ready

Revisions

You can edit these tests or add more tests to this page by appending /edit to the URL.