SpringAntMatcherOrderCheck extends AbstractMethodDetection { @VisibleForTesting static String antMatcherToRegEx(String pattern) { return escapeRegExpChars(pattern) .replace("?", "[^/]") .replace("**", "$$") .replace("*", "[^/]*") .replace("$$", ".*"); }    }
@Test void ant_matcher_to_regex() { assertThat(antMatcherToRegEx("abc")).isEqualTo("abc"); assertThat(antMatcherToRegEx("a?c")).isEqualTo("a[^/]c"); assertThat(antMatcherToRegEx("a*c")).isEqualTo("a[^/]*c"); assertThat(antMatcherToRegEx("a**c")).isEqualTo("a.*c"); assertThat(antMatcherToRegEx("a**b*c")).isEqualTo("a.*b[^/]*c"); }