email-validator (v2)

Revision 2 of this benchmark created on


Setup

var complexPatternStr = '^\\w+([\\.\\+-]*\\w+)*@\\w+([\\.\\+-]*\\w+)*(\\.\\w{2,6})+$';
    var complexPattern = new RegExp(complexPatternStr);
    
    var simplePatternStr = '^\\S+@\\S+$';
    var simplePattern = new RegExp(simplePatternStr);
    
    var email = 'longishemail123@longsubdomain.longdomain.tld';

Test runner

Ready to run.

Testing in
TestOps/sec
complex uncompiled
/^\w+([\.\+-]*\w+)*@\w+([\.\+-]*\w+)*(\.\w{2,6})+$/.test(email)
 
ready
complex compiled
complexPattern.test(email)
 
ready
simple uncompiled
/^\S+@\S+$/.test(email);
 
ready
simple compiled
simplePattern.test(email)
 
ready
complex uncompiled 2
new RegExp(complexPatternStr).test(email)
 
ready
simple uncompiled 2
new RegExp(simplePatternStr).test(email);
 
ready

Revisions

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