case-sensitive regex vs case-insensitive regex

Benchmark created on


Setup

var string = 'function name(arg1, arg2) { [native code] }';
    var sensitive = /function\s?(.*?)(?:\(.*?\))\s?{/;
    var insensitive = /function\s?(.*?)(?:\(.*?\))\s?{/i;

Test runner

Ready to run.

Testing in
TestOps/sec
case-sensitive
var name = string.match(sensitive)[1];
ready
case-insensitive
var name = string.match(insensitive)[1];
ready

Revisions

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