Код: Выделить всё
text abc
Текст может содержать разрывы строк:
Код: Выделить всё
text
abc
См. шаблон DOTALL
Мой код:
Код: Выделить всё
String text = "text abc";
Pattern pattern = Pattern.compile("(.+) abc");
Matcher m = pattern.matcher(text);
while (m.find()) {
System.out.println(m.group(1));
}
Подробнее здесь: https://stackoverflow.com/questions/501 ... terminator
Мобильная версия