diff --git a/asm/src/main/java/dev/openrs2/asm/filter/Glob.kt b/asm/src/main/java/dev/openrs2/asm/filter/Glob.kt index 076f3fce..30013474 100644 --- a/asm/src/main/java/dev/openrs2/asm/filter/Glob.kt +++ b/asm/src/main/java/dev/openrs2/asm/filter/Glob.kt @@ -12,11 +12,8 @@ object Glob { private fun compile(pattern: String, className: Boolean): Regex { val regex = StringBuilder() var star = false - var escape = false for (ch in pattern) { - check(!star || !escape) - if (star) { star = false @@ -26,9 +23,6 @@ object Glob { } regex.append("[^/]*") - } else if (escape) { - regex.append(Regex.escape(ch.toString())) - continue } when (ch) { @@ -37,7 +31,6 @@ object Glob { } else { regex.append(".*") } - '\\' -> escape = true else -> regex.append(Regex.escape(ch.toString())) } } @@ -46,10 +39,6 @@ object Glob { regex.append(".*") } - require(!escape) { - "Unterminated escape sequence" - } - return Regex(regex.toString()) } }