Skip to content

Commit

Permalink
Improve validity check of email addresses nus-cs2103-AY2122S2#71 (nus…
Browse files Browse the repository at this point in the history
…-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.
  • Loading branch information
aditi2313 authored Feb 24, 2022
1 parent 7aa7efe commit b17f4ec
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/main/java/seedu/address/model/person/Email.java
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down

0 comments on commit b17f4ec

Please sign in to comment.