Remove validateEmail entirely (#294).
This commit is contained in:
@ -1,12 +0,0 @@
|
|||||||
### validateEmail
|
|
||||||
|
|
||||||
Returns `true` if the given string is a valid email, `false` otherwise.
|
|
||||||
|
|
||||||
Use a regular expression to check if the email is valid.
|
|
||||||
Returns `true` if email is valid, `false` if not.
|
|
||||||
|
|
||||||
```js
|
|
||||||
const validateEmail = str =>
|
|
||||||
/^(([^<>()\[\]\\.,;:\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,}))$/.test(str);
|
|
||||||
// validateEmail(mymail@gmail.com) -> true
|
|
||||||
```
|
|
||||||
Reference in New Issue
Block a user