-
Notifications
You must be signed in to change notification settings - Fork 6
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
Bug fix: Update name param to include more characters #320
Bug fix: Update name param to include more characters #320
Conversation
Currently, the name accepts alphanumerical characters, spaces, and forward slashes. This will allow the majority of names to be added into the app. However, it has come to light that there are names which would contain other characters that would throw errors if users attempt to add these names in, which is problematic since some special characters like `.` and `,` are common. Let's allow several other characters in the regex for names. In doing so, we can ensure that most common names will be successfully added into the application.
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 changes!
+ "and it should not be blank"; | ||
|
||
/* | ||
* The first character of the address must not be a whitespace, | ||
* otherwise " " (a blank string) becomes a valid input. | ||
*/ | ||
public static final String VALIDATION_REGEX = "[\\p{Alnum}][\\p{Alnum} /]{1,79}"; | ||
public static final String VALIDATION_REGEX = "[\\p{Alnum}][\\p{Alnum} ,-./()]{1,79}"; |
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 that the message constraints is all managed in one place!
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.
Good catch, if not we cant even add our groupmate's name inside!
Fixes #319
Currently, the name accepts alphanumerical characters, spaces, and
forward slashes. This will allow the majority of names to be added
into the app.
However, it has come to light that there are names which would contain
other characters that would throw errors if users attempt to add these
names in, which is problematic since some special characters like
.
and
,
are common.Let's allow several other characters in the regex for names.
In doing so, we can ensure that most common names will be successfully
added into the application.