Код: Выделить всё
\Z The end of the input but for the final terminator, if any
\z The end of the input
В моем тесте я думал, что "StackOverflow\n".matches("StackOverflow\\z") вернет true, а "StackOverflow\n".matches("StackOverflow\\Z") вернет false. Но на самом деле оба возвращают false. Где ошибка?
Подробнее здесь: https://stackoverflow.com/questions/270 ... en-and-how
Мобильная версия