From b17f4ec5c45d195b880b1edb78c1eaf98077017e Mon Sep 17 00:00:00 2001 From: aditi2313 <52269537+aditi2313@users.noreply.github.com> Date: Fri, 25 Feb 2022 01:05:28 +0800 Subject: [PATCH] Improve validity check of email addresses nus-cs2103-AY2122S2#71 (nus-cs2103-AY2122S2#78) The email validation regex does not detect certain incorrect email formats and wrongly rejects correct ones. Let's * improve the regex to better account for email formats encountered in real life. * modify unit tests to test the new regex. * refine the messages shown to users to better describe the correct format for emails. --- src/main/java/seedu/address/model/person/Email.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/main/java/seedu/address/model/person/Email.java b/src/main/java/seedu/address/model/person/Email.java index 126842e50e4..f866e7133de 100644 --- a/src/main/java/seedu/address/model/person/Email.java +++ b/src/main/java/seedu/address/model/person/Email.java @@ -45,7 +45,7 @@ public Email(String email) { } /** - * Returns if a given string is a valid email.\ + * Returns if a given string is a valid email. */ public static boolean isValidEmail(String test) { return test.matches(VALIDATION_REGEX);