Skip to content

Commit

Permalink
Merge pull request #108 from dedsecrattle/fix/bugs
Browse files Browse the repository at this point in the history
Fix Bugs
  • Loading branch information
dedsecrattle authored Apr 4, 2024
2 parents 68f18f9 + 423bcf8 commit 498c753
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions src/main/java/seedu/edulink/model/tag/Tag.java
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,8 @@
*/
public class Tag {

public static final String MESSAGE_CONSTRAINTS = "Tags names should be alphanumeric";
public static final String MESSAGE_CONSTRAINTS = "Tags names should be alphanumeric"
+ " and not more than 15 characters";
public static final String VALIDATION_REGEX = "\\p{Alnum}+";

public final String tagName;
Expand All @@ -29,7 +30,7 @@ public Tag(String tagName) {
* Returns true if a given string is a valid tag name.
*/
public static boolean isValidTagName(String test) {
return test.matches(VALIDATION_REGEX);
return test.matches(VALIDATION_REGEX) && test.length() <= 15;
}

@Override
Expand Down

0 comments on commit 498c753

Please sign in to comment.