Skip to content

Commit

Permalink
Merge pull request #405 from georgejecook/regex-fix-email-validation
Browse files Browse the repository at this point in the history
  • Loading branch information
georgejecook authored Aug 7, 2023
2 parents dec41a0 + c8470bd commit ca031c9
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 1 deletion.
1 change: 1 addition & 0 deletions src/source/view/ValidationUtils.spec.bs
Original file line number Diff line number Diff line change
Expand Up @@ -166,6 +166,7 @@ namespace tests
@params("aaa@bbb", true, "Invalid email address.")
@params("aaa@bbb.", true, "Invalid email address.")
@params("[email protected]", false, "")
@params("[email protected]", false, "")
function _(value, expected, message)
result = m.validator.validateEmail(value)

Expand Down
2 changes: 1 addition & 1 deletion src/source/view/controls/ValidationUtils.bs
Original file line number Diff line number Diff line change
Expand Up @@ -118,7 +118,7 @@ namespace mv.input.validators

private function validateEmail(value as string)
m.log.info("Validating email", value)
regex = createObject("roRegex", "^[\w-\.]+@([\w-]+\.)+[\w-]{2,4}$", "i")
regex = createObject("roRegex", "^[\w-\.+]+@([\w-]+\.)+[\w-]{2,4}$", "i")
isValid = regex.isMatch(value)

return {
Expand Down

0 comments on commit ca031c9

Please sign in to comment.