Skip to content

Commit 77d3c8a

Browse files
authored
Merge pull request #1 from SumithThota/update-email-pattern
Updated with Comprehensive email regex pattern
2 parents 1eae7e3 + 2e6b6f3 commit 77d3c8a

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

Client-Side Components/Client Scripts/Validate Email Format/ValidateEmailFormat.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22

33
function onSubmit() {
44
var emailField = g_form.getValue('email');
5-
var emailPattern = /^[^\s@]+@[^\s@]+\.[^\s@]+$/;
5+
var emailPattern = /^(([^<>()\[\]\\.,;:\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,}))$/;
66

77
if (!emailPattern.test(emailField)) {
88
g_form.addErrorMessage('Please enter a valid email address.');

0 commit comments

Comments
 (0)