Skip to content

Commit

Permalink
MAT-7737 move regext to class level
Browse files Browse the repository at this point in the history
  • Loading branch information
adongare committed Oct 24, 2024
1 parent 4a2b545 commit ad37f59
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/main/java/gov/cms/madie/models/common/ModelType.java
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@ public enum ModelType {
private String value;
private String shortValue;
private static final Map<String, ModelType> MODEL_TYPE_BY_VALUE = new HashMap<>();
private static final Pattern VERSION_PATTERN = Pattern.compile("v(\\d+(\\.\\d+)*)");

static {
for (ModelType mt : values()) {
Expand All @@ -36,8 +37,7 @@ public enum ModelType {
}

public String getVersionNumber() {
Pattern pattern = Pattern.compile("v(\\d+(\\.\\d+)*)");
Matcher matcher = pattern.matcher(this.value);
Matcher matcher = VERSION_PATTERN.matcher(this.value);
return matcher.find() ? matcher.group(1) : null;
}

Expand Down

0 comments on commit ad37f59

Please sign in to comment.