Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update validation regex for name #277

Merged
merged 2 commits into from
Nov 13, 2023

Conversation

Sheeepen
Copy link

Should only now allow for inputs that start off with a capitalised letter for each word and the rest are lower case.
e.g. John Doe is accepted, but joHn doE, john doe, JOHN DOE are all not allowed

@Sheeepen Sheeepen added this to the v1.4 milestone Nov 13, 2023
@Sheeepen Sheeepen linked an issue Nov 13, 2023 that may be closed by this pull request
Copy link

codecov bot commented Nov 13, 2023

Codecov Report

All modified and coverable lines are covered by tests ✅

Files Coverage Δ
...rc/main/java/seedu/address/model/student/Name.java 92.85% <100.00%> (ø)
...java/seedu/address/storage/JsonAdaptedStudent.java 95.91% <100.00%> (+0.08%) ⬆️

📢 Thoughts on this report? Let us know!

Copy link

@darrentfy darrentfy left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@@ -16,7 +16,7 @@ public class Name {
* The first character of the name must not be a whitespace,
* otherwise " " (a blank string) becomes a valid input.
*/
public static final String VALIDATION_REGEX = "^[A-Za-z][A-Za-z ]{0,99}$";
public static final String VALIDATION_REGEX = "^(?=.{1,100}$)[A-Z][a-z]*([ ][A-Z][a-z]*)*\\s*$";

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Very interesting regex here 🤔

@darrentfy darrentfy merged commit 0b8fddc into AY2324S1-CS2103T-W13-4:master Nov 13, 2023
5 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Appointment accepts different name casing
2 participants