Exec() vs. Match()

Benchmark created by Spencer Creasey on


Description

Tests the performance between Javascript's .exec() and .match().

Preparation HTML

<script>
  var regex = /\d+_(\d+)_/;
  var value = "asdfjalsdkfj_89734_08934_asdaskjdk";
</script>

Test runner

Ready to run.

Testing in
TestOps/sec
.match()
value.match(regex)
ready
.exec()
regex.exec(value)
ready

Revisions

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