on master help sign in
fix: use W3C email validator regex
9b85bb1Matt Condon (shrugs)
src/lib/validators.js+3−3
@@ -3,10 +3,10 @@ import * as ob from 'urbit-ob';
3
3
4import { isValidAddress } from './wallet';
4import { isValidAddress } from './wallet';
5
5
6−// via: https://emailregex.com/
6+// W3C HTML5 type="email" validation regex 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,}))$/;
7+const emailRegExp = /^[a-zA-Z0-9.!#$%&’*+/=?^_`{|}~-]+@[a-zA-Z0-9-]+(?:\.[a-zA-Z0-9-]+)*$/;
8
8
9−// is this hex?
9+// is this 64 hex chars?
10const hexRegExp = /[0-9A-Fa-f]{64}/g;
10const hexRegExp = /[0-9A-Fa-f]{64}/g;
11
11
12// Wraps single validation functions in a controlled and predictable way.
12// Wraps single validation functions in a controlled and predictable way.