Synchronize sdnr/wt data-provider, websocketmanager, netconfstate-provider
[ccsdk/features.git] / sdnr / wt / netconfnode-state-service / provider / src / main / java / org / onap / ccsdk / features / sdnr / wt / netconfnodestateservice / impl / conf / odlGeo / ClusterRoleInfo.java
index 8f4446b..f11ce40 100644 (file)
@@ -25,7 +25,10 @@ public class ClusterRoleInfo {
     private final int Index;
 
     public ClusterRoleInfo(String s) throws Exception {
-        final String regex = "([a-zA-Z]*)-([0-9]*)";
+        // role with minimum 1 character
+        // index with minimum 1 character or Integer.parseInt raise an exception
+        // index with maximum 10 because it's an integer
+        final String regex = "([a-zA-Z]{1,1024})-([0-9]{1,10})";
         final Pattern pattern = Pattern.compile(regex);
         final Matcher matcher = pattern.matcher(s);
         if (!matcher.find()) {