fr5gg5

Benchmark created on


Test runner

Ready to run.

Testing in
TestOps/sec
first
String.prototype.regexIndexOf = function(regex, startpos) {
  var indexOf = this.substring(startpos || 0).search(regex);
  return (indexOf >= 0) ? (indexOf + (startpos || 0)) : indexOf;
}
var cssText = "#div2{left: 375px;top: 250px;height: 40px;width:100px;position: absolute;background-color: #66CCFF;};";
var id = "#div2";
cssText.regexIndexOf(/left\s*?:\s*?\d+px;/ig)
ready
second
String.prototype.regexIndexOf = function(regex, startpos) {
  var indexOf = this.substring(startpos || 0).search(regex);
  return (indexOf >= 0) ? (indexOf + (startpos || 0)) : indexOf;
}
var cssText = "#div2{left: 375px;top: 250px;height: 40px;width:100px;position: absolute;background-color: #66CCFF;};";
var id = "#div2";
cssText.regexIndexOf(/left\s*?:([^;]*)px;/ig)
ready

Revisions

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