FazBrowse GitHub Viewer
|
Trending
|
URL:
|
Home
Tools:
[Download Repo ZIP]
[View Raw Code]
[Original HTTPS Page]
JavaScriptAlgorithms/String/ValidateEmail.js at master · seba1rx/JavaScriptAlgorithms · GitHub
seba1rx
/
JavaScriptAlgorithms
Public
forked from
TheAlgorithms/JavaScript
Notifications
You must be signed in to change notification settings
Fork
0
Star
0
Code
Pull requests
0
Actions
Projects
Security and quality
0
Insights
Additional navigation options
Code
Pull requests
Actions
Projects
Security and quality
Insights
Expand file tree
Breadcrumbs
JavaScriptAlgorithms
/
String
/
ValidateEmail.js
Copy path
More file actions
More file actions
Latest commit
History
History
History
12 lines (10 loc) · 290 Bytes
Breadcrumbs
JavaScriptAlgorithms
/
String
/
ValidateEmail.js
Copy path
File metadata and controls
12 lines (10 loc) · 290 Bytes
Raw
Copy raw file
Download raw file
Open symbols panel
Edit and raw actions
1
2
3
4
5
6
7
8
9
10
11
12
/**
* Returns whether the given string is a valid email address or not.
*/
const
validateEmail
=
(
str
)
=>
{
if
(
str
===
''
||
str
===
null
)
{
throw
new
TypeError
(
'Email Address String Null or Empty.'
)
}
return
/
^
[
^
\s
@
]
+
@
[
^
\s
@
]
+
\.
[
^
\s
@
]
+
$
/
.
test
(
str
)
}
export
{
validateEmail
}
Back
|
FazBrowse Home
|
New Git URL