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