mirror of
https://github.com/jlengrand/jreleaser.git
synced 2026-03-10 08:31:24 +00:00
[changelog] Handle regex inputs for labelers. Fixes #213
This commit is contained in:
@@ -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) {
|
||||
|
||||
Reference in New Issue
Block a user