Код: Выделить всё
Matcher matcher = null;
Pattern pattern = null;
try
{
pattern = Pattern.compile(".*" + "Unbekannter Fehler: while trying to invoke the method test() of a null object loaded from local variable 'libInfo'" + ".*", Pattern.CASE_INSENSITIVE & Pattern.DOTALL);
matcher = pattern.matcher("Unbekannter Fehler: while trying to invoke the method test() of a null object loaded from local variable 'libInfo'");
if (matcher.matches())
System.out.println("Same!");
}
< /code>
Если я запускаю приведенный выше код, он возвращает false < /code>, но почему? Я просто хочу проверить, если текст содержится другим с регулярным выражением (no String.contains (...) Подробнее здесь: https://stackoverflow.com/questions/366 ... ven-string