non-capture groups

Benchmark created on


Test runner

Ready to run.

Testing in
TestOps/sec
with non-capture
function isStylesheet(path) {
  return /styles(?:\.[\da-f]+)?\.css$/.test(path);
}

isStylesheet("styles.css"); // true
isStylesheet("styles.1234.css"); // true
isStylesheet("styles.cafe.css"); // true
isStylesheet("styles.1234.min.css"); // false
ready
without non-capture
function isStylesheet(path) {
  return /styles(\.[\da-f]+)?\.css$/.test(path);
}

isStylesheet("styles.css"); // true
isStylesheet("styles.1234.css"); // true
isStylesheet("styles.cafe.css"); // true
isStylesheet("styles.1234.min.css"); // false
ready

Revisions

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