[changelog] Handle regex inputs for labelers. Fixes #213

This commit is contained in:
Andres Almiray
2021-06-10 23:26:26 +02:00
parent d0bc316e0d
commit fe0b1a75e2

View File

@@ -610,7 +610,16 @@ public class StringUtils {
}
public static String toSafeRegexPattern(String str) {
return ".*" + escapeRegexChars(str) + ".*";
StringBuilder b = new StringBuilder();
if (!str.startsWith("^")) {
b.append(".*");
}
b.append(str);
if (!str.endsWith("$")) {
b.append(".*");
}
return b.toString();
}
public static Pattern toSafePattern(String str) {