diff --git a/server/src/main/java/org/opensearch/common/regex/Regex.java b/server/src/main/java/org/opensearch/common/regex/Regex.java index f044e02ffd8b3..3cede72486094 100644 --- a/server/src/main/java/org/opensearch/common/regex/Regex.java +++ b/server/src/main/java/org/opensearch/common/regex/Regex.java @@ -160,7 +160,7 @@ private static boolean simpleMatchWithNormalizedStrings(String pattern, String s // str.endsWith(pattern.substring(1)), but avoiding the construction of pattern.substring(1): return str.regionMatches(str.length() - pattern.length() + 1, pattern, 1, pattern.length() - 1); } else if (nextIndex == 1) { - throw new IllegalArgumentException("Input pattern " + pattern + " contains duplicate adjacent wildcards (*)."); + throw new IllegalArgumentException("Invalid input. Input must not contain adjacent duplicate wildcards."); } final String part = pattern.substring(1, nextIndex); int partIndex = str.indexOf(part);