Tries to match the message with the match string. Use in match string will match any characters. Use ? will match a single character. @param message The message that should be checked. @param find The pattern. @return true, if the Pattern matches the message.
(String message, String find)
| 484 | * @return {@code true}, if the Pattern matches the message. |
| 485 | */ |
| 486 | public static boolean contains(String message, String find) { |
| 487 | message = message.toLowerCase(Locale.ROOT); |
| 488 | Pattern pattern = compileMatchPattern(find); |
| 489 | Matcher matcher = pattern.matcher(message); |
| 490 | |
| 491 | return matcher.find(); |
| 492 | } |
| 493 | |
| 494 | public static Pattern compileMatchPattern(String match) { |
| 495 | // replace duplicate stars |
no test coverage detected