Character class
JavaScript performance comparison
Info
Test positive match of character class vs negative match of complement.
Preparation code
<script>
Benchmark.prototype.setup = function() {
var nospecial=/^[^*|\":<>[\]{}`\\()';@&$]+$/;
var special=/[*|\":<>[\]{}`\\()';@&$]/;
var address = "This is an address";
var address2 = "This is an address@work";
};
</script>
Test runner
Warning! For accurate results, please disable Firebug before running the tests. (Why?)
Java applet disabled.
| Test | Ops/sec | |
|---|---|---|
no special |
|
pending… |
special |
|
pending… |
You can edit these tests or add even more tests to this page by appending /edit to the URL.
0 comments