spring-framework / org.springframework.util / PatternMatchUtils / simpleMatch

simpleMatch

open static fun simpleMatch(@Nullable pattern: String, @Nullable str: String): Boolean

Match a String against the given pattern, supporting the following simple pattern styles: "xxx*", "*xxx", "*xxx*" and "xxx*yyy" matches (with an arbitrary number of pattern parts), as well as direct equality.

Parameters

pattern - the pattern to match against

str - the String to match

Return
whether the String matches the given pattern

open static fun simpleMatch(@Nullable patterns: Array<String>, str: String): Boolean

Match a String against the given patterns, supporting the following simple pattern styles: "xxx*", "*xxx", "*xxx*" and "xxx*yyy" matches (with an arbitrary number of pattern parts), as well as direct equality.

Parameters

patterns - the patterns to match against

str - the String to match

Return
whether the String matches any of the given patterns