Skip to content

Commit

Permalink
changes for group and external system
Browse files Browse the repository at this point in the history
  • Loading branch information
juhiagl8 committed May 30, 2023
1 parent 9aaca83 commit 3fb2a88
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/main/java/org/sunbird/common/util/ProjectUtil.java
Original file line number Diff line number Diff line change
Expand Up @@ -152,15 +152,15 @@ public static Boolean validateLastName( String lastName ) {

public static Boolean validateTag(List<String> tags) {
for (String tag : tags) {
if (!tag.matches("[a-zA-Z ]*")) {
if (!tag.matches("^[a-zA-Z]+(?: [a-zA-Z]+)*$")) {
return false;
}
}
return true;
}

public static Boolean validateExternalSystemId(String externalSystemId) {
return externalSystemId.matches("[a-zA-Z0-9]{0,30}$");
return externalSystemId.matches("^(?=.{1,30}$)[a-zA-Z0-9]+(?:-[a-zA-Z0-9]+)*$");
}

public static Boolean validateExternalSystem(String externalSystem) {
Expand Down

0 comments on commit 3fb2a88

Please sign in to comment.