This repository has been archived by the owner on Sep 9, 2022. It is now read-only.
forked from nus-cs2103-AY2122S2/tp
-
Notifications
You must be signed in to change notification settings - Fork 5
Bug - Fix PED issues #191
Merged
lchokhoe
merged 4 commits into
AY2122S2-CS2103T-T11-3:master
from
joszx:branch-fix-PED-bugs
Apr 8, 2022
Merged
Bug - Fix PED issues #191
lchokhoe
merged 4 commits into
AY2122S2-CS2103T-T11-3:master
from
joszx:branch-fix-PED-bugs
Apr 8, 2022
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Make changes to valid email regex to require top level domain e.g ".com" Modify and add test cases regarding valid email
Modify add and edit command duplicate application messages. Change how application checks for a duplicate application. Add and tweak test cases regarding duplicate applications. Add note and FAQ on duplicate applications to UG.
This was
linked to
issues
Apr 6, 2022
Codecov Report
@@ Coverage Diff @@
## master #191 +/- ##
============================================
+ Coverage 61.95% 62.10% +0.15%
- Complexity 475 482 +7
============================================
Files 96 96
Lines 1853 1871 +18
Branches 227 232 +5
============================================
+ Hits 1148 1162 +14
- Misses 635 639 +4
Partials 70 70
Continue to review full report at Codecov.
|
yongler
approved these changes
Apr 6, 2022
Comment on lines
25
to
+34
// alphanumeric and special characters | ||
private static final String ALPHANUMERIC_NO_UNDERSCORE = "[^\\W_]+"; // alphanumeric characters except underscore | ||
private static final String LOCAL_PART_REGEX = "^" + ALPHANUMERIC_NO_UNDERSCORE + "([" + SPECIAL_CHARACTERS + "]" | ||
+ ALPHANUMERIC_NO_UNDERSCORE + ")*"; | ||
private static final String DOMAIN_PART_REGEX = ALPHANUMERIC_NO_UNDERSCORE | ||
+ "(-" + ALPHANUMERIC_NO_UNDERSCORE + ")*"; | ||
private static final String DOMAIN_LAST_PART_REGEX = "(" + DOMAIN_PART_REGEX + "){2,}$"; // At least two chars | ||
private static final String DOMAIN_REGEX = "(" + DOMAIN_PART_REGEX + "\\.)*" + DOMAIN_LAST_PART_REGEX; | ||
private static final String DOMAIN_MIDDLE_PART_REGEX = "(\\.*(" + DOMAIN_PART_REGEX + ")+)*\\."; // Multiple .co.in | ||
private static final String DOMAIN_REGEX = "(" + DOMAIN_PART_REGEX + ")+" + DOMAIN_MIDDLE_PART_REGEX | ||
+ DOMAIN_LAST_PART_REGEX; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Nice regex checking!
This might be useful too: https://stackoverflow.com/questions/624581/what-is-the-best-java-email-address-validation-method, but as mentioned in the comments of the first post there might be some edge cases as well
Other than the suggestion, LGTM!
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Fix PED issues
Key Summary
Other Updates
Fix #171, #152, #150, #146