diff options
Diffstat (limited to 'src/com/gitblit/utils/StringUtils.java')
-rw-r--r-- | src/com/gitblit/utils/StringUtils.java | 13 |
1 files changed, 13 insertions, 0 deletions
diff --git a/src/com/gitblit/utils/StringUtils.java b/src/com/gitblit/utils/StringUtils.java index d115f896..02cc49fd 100644 --- a/src/com/gitblit/utils/StringUtils.java +++ b/src/com/gitblit/utils/StringUtils.java @@ -692,4 +692,17 @@ public class StringUtils { }
return path;
}
+
+ /**
+ * Variation of String.matches() which disregards case issues.
+ *
+ * @param regex
+ * @param input
+ * @return true if the pattern matches
+ */
+ public static boolean matchesIgnoreCase(String input, String regex) {
+ Pattern p = Pattern.compile(regex, Pattern.CASE_INSENSITIVE);
+ Matcher m = p.matcher(input);
+ return m.matches();
+ }
}
\ No newline at end of file |