regexp

JavaScript performance comparison

Test case created

Preparation code

 
<script>
Benchmark.prototype.setup = function() {
    var test = ["A01AA01", "Z01AA01", "A01AB01", "A01AC01", "A01AD01", "A01AE01", "A01FA0X", ];
};
</script>

Test runner

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

Java applet disabled.

Testing in unknown unknown
Test Ops/sec
no
var patt = /^\w(\d\d(\w(\w(\d\d)?)?)?)?$/i;
for (var text in test) {
  if (text.match(patt)) {
    test = "yes"
  } else {
    test = "no"
  }
}
pending…
yes
var patt = /^[ABCDGHJLMNPRSV](\d\d(\w(\w(\d\d)?)?)?)?$/i;
for (var text in test) {
  if (text.match(patt)) {
    test = "yes"
  } else {
    test = "no"
  }
}
pending…

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

Compare results of other browsers

0 comments

Add a comment