Toggle navigation
MeasureThat
.net
Create a benchmark
Tools
Feedback
FAQ
Register
Log In
Run results for:
RegExp.exec vs String.match vs RegExp.test vs RegExp.match
Go to the benchmark
Embed
Embed Benchmark Result
Run details:
User agent:
Mozilla/5.0 (Android 10; Mobile; rv:122.0) Gecko/122.0 Firefox/122.0
Browser:
Firefox Mobile 122
Operating system:
Android
Device Platform:
Mobile
Date tested:
2 years ago
regex.test
27.7M/s
regex.exec
18.9M/s
string.match
15.4M/s
regex.match
13.4M/s
View exact numbers
Test name
Executions per second
✓
regex.test
27,684,012 Ops/sec
regex.exec
18,901,826 Ops/sec
string.match
15,395,009 Ops/sec
regex.match
13,430,636 Ops/sec
Script Preparation code:
var string = "Hello world!"; var regex = /[A-Z][a-z]+ [a-z]+/;
Tests:
regex.exec
regex.exec(string);
string.match
string.match(regex);
regex.test
regex.test(string);
regex.match
regex[Symbol.match](string);