RegExp test vs. Match (v5)

Revision 5 of this benchmark created on


Preparation HTML

<script>
  var strings = [];
  strings[0] = "Cannot determine the type of phrase for 'boodah.'";
  strings[1] = "Cannot determine the type of phrase for 'boodah  .'";
  strings[2] = "Cannot determine the type of phrase for 'boodah  Then the new   .'";  
  var regex1 = /[^\w']'(.*\s*.*)*'/;
</script>

Test runner

Ready to run.

Testing in
TestOps/sec
Match
var list = [];
for (var i = 0; i < strings.length; ++i) {
  var b = strings[i].match(regex1),
    b2 = strings[i].match(regex1),
    b3 = strings[i].match(regex1);
  list.push(b || b2 || b3);
}
ready
Test
var list = [];
for (var i = 0; i < strings.length; ++i) {
  var b = regex1.test(strings[i]),
    b2 = regex1.test(strings[i]),
    b3 = regex1.test(strings[i]);
  list.push(b || b2 || b3);
}
ready

Revisions

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