RegExp /[a-z]/i vs /[a-zA-Z]/

Benchmark created by Rob W on


Preparation HTML

<script>
  var string = new Array(1000).join("aAbB");
  var regWithI = /[a-z]/i;
  var regAZ  = /[A-Za-z]/;
</script>

Test runner

Ready to run.

Testing in
TestOps/sec
With i-flag
string.match(regWithI);
ready
Without i-flag
string.match(regAZ);
ready

Revisions

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