Skip to content

Instantly share code, notes, and snippets.

Created November 21, 2016 20:06
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save anonymous/cb167f6f77b8783fdc8426ccf0f15481 to your computer and use it in GitHub Desktop.
Save anonymous/cb167f6f77b8783fdc8426ccf0f15481 to your computer and use it in GitHub Desktop.
(()=>{
let rgxEmail = /^\w+([\.-]?\w+)*@\w+([\.-]?\w+)*(\.\w{1,3})+$/;
let t1 = Date.now();
let passTest = rgxEmail.test('abcdefghijklmnopqrstuvwxyza');
let ms = Date.now() - t1;
alert(ms);
})()
// 132 ms stopping at 24 chars
// 245 ms when stopping at 25 chars
// 484 ms when at 26 chars
// 1046 ms when at 27 chars
// 35916 ms(!) at 28 chars
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment