Test name | Executions per second |
---|---|
new RegExp() | 1297795.1 Ops/sec |
Literal | 1337136.4 Ops/sec |
var reConstructor = new RegExp('^[0-9a-fA-F]{24}$')
var reLiteral = /^[0-9a-fA-F]{24}$/
reConstructor.test('132abc67219f019afe12901a')
reLiteral.test('132abc67219f019afe12901a')