Regex methods

JavaScript performance comparison

Test case created by Nevallem

Preparation code


      
      <script>
Benchmark.prototype.setup = function() {
  var str = 'Teste 1,\n 52,56368,9)7(9.9q7w7,*e*d*/;7.b/,a',
  	regex = /[^aeiou0-9\s]/g;

};
</script>

Test runner

Warning! For accurate results, please disable Firebug before running the tests. (Why?)

Java applet disabled.

Testing in CCBot 2.0.0 / Other 0.0.0
Test Ops/sec
String.match
str.match( regex );
pending…
Regex.exec
regex.exec( str );
pending…
String.search
str.search( regex ) !== -1;
pending…
Regex.test
regex.test( str );
pending…

Compare results of other browsers

Revisions

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

0 Comments