on master help sign in
fix: use W3C email validator regex
commit9b85bb1476b43bd46a1310b29bed38266f0418b8 authorMatt Condon (shrugs) <mattgcondon@gmail.com> dateTue 25 Jun 2019, 08:34 (7 years ago) parentf34e8d0
1 file changed+3−3
src/lib/validators.js+3−3
src/lib/validators.js+3−3
@@ -3,10 +3,10 @@ import * as ob from 'urbit-ob';
33
44import { isValidAddress } from './wallet';
55
6−// via: https://emailregex.com/
7−const emailRegExp = /^(([^<>()[\]\\.,;:\s@"]+(\.[^<>()[\]\\.,;:\s@"]+)*)|(".+"))@((\[[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}])|(([a-zA-Z\-0-9]+\.)+[a-zA-Z]{2,}))$/;
6+// W3C HTML5 type="email" validation regex via: https://emailregex.com/
7+const emailRegExp = /^[a-zA-Z0-9.!#$%&’*+/=?^_`{|}~-]+@[a-zA-Z0-9-]+(?:\.[a-zA-Z0-9-]+)*$/;
88
9−// is this hex?
9+// is this 64 hex chars?
1010const hexRegExp = /[0-9A-Fa-f]{64}/g;
1111
1212// Wraps single validation functions in a controlled and predictable way.