Skip to content

Commit

Permalink
Merge pull request #363 from Incogdino/branch-updateEmailErrorMessage
Browse files Browse the repository at this point in the history
Update email restrictions
  • Loading branch information
DesSnowy authored Nov 10, 2024
2 parents 3b291d4 + ccb4c8c commit 5e4cc26
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 4 deletions.
6 changes: 4 additions & 2 deletions docs/UserGuide.md
Original file line number Diff line number Diff line change
Expand Up @@ -236,8 +236,10 @@ Eg. `n/John` or `name/john`

<md>**Email restrictions**</md>
Emails should be of the format `local-part@domain` and adhere to the following constraints:
1. `local-part` should only contain English alphanumeric characters and `+`, `_` , `.` , `-`.
2. `local-part` may not start or end with any special characters.
1. `local-part` should only contain English alphanumeric characters and `+`, `_` , `.` , `-`.
The `local-part` name:
- may not start or end with any special characters.
- may not have any consecutive special characters.
3. This is followed by an `@` and then a `domain` name. The domain name is made up of domain labels separated by periods.
The `domain name` must:
- end with a domain label at least 2 characters long
Expand Down
6 changes: 4 additions & 2 deletions src/main/java/seedu/address/model/person/Email.java
Original file line number Diff line number Diff line change
Expand Up @@ -13,8 +13,10 @@ public class Email {
public static final String MESSAGE_CONSTRAINTS = "Emails should be of the format local-part@domain "
+ "and adhere to the following constraints:\n"
+ "1. The local-part should only contain alphanumeric characters and these special characters, excluding "
+ "the parentheses, (" + SPECIAL_CHARACTERS + "). The local-part may not start or end with any special "
+ "characters.\n"
+ "the parentheses, (" + SPECIAL_CHARACTERS + ").\n"
+ "The local-part name:\n"
+ " - May not start or end with any special characters.\n"
+ " - May not have any consecutive special characters.\n"
+ "2. This is followed by a '@' and then a domain name. The domain name is made up of domain labels "
+ "separated by periods.\n"
+ "The domain name must:\n"
Expand Down

0 comments on commit 5e4cc26

Please sign in to comment.