Toggle navigation
MeasureThat.net
Create a benchmark
Tools
Feedback
FAQ
Register
Log In
Run results for:
Test benchmark 123
Go to the benchmark
Embed
Embed Benchmark Result
Run details:
User agent:
Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/124.0.0.0 Safari/537.36
Browser:
Chrome 124
Operating system:
Linux
Device Platform:
Desktop
Date tested:
2 years ago
Test name
Executions per second
RegEx.test
10124943.0 Ops/sec
String.includes
194543904.0 Ops/sec
Script Preparation code:
var string = "P400 Dynamic HSE 4dr SUV AWD w/Zadar Grey Premium Metallic Paint (3.0L 6cyl Twincharger gas/electric mild hybrid 8A)"; var regex = /^[\w\s\-.'"()#+!]+/;
Tests:
RegEx.test
regex.test(string);
String.includes
function mimicRegex(string) { const allowedChars = new Set(`abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789_\-.\'"()#+! `); let index = 0; for (let char of str) { if (!allowedChars.has(char)) { return str.substring(0, index); } index++; } return str; // Return the entire string if it matches the regex }