Этот код Java должен вести себя так же: < /p>
Код: Выделить всё
Pattern regex = Pattern.compile("(?u)\\b\\w\\w+\\b");
Matcher matcher = regex.matcher("this is the document.!? äöa m²");
while(matcher.find()) {
String match = matcher.group();
System.out.println(match);
}
< /code>
Но это не производит желаемый вывод, как это происходит в Python: < /p>
this
is
the
document
äöa
m²
< /code>
Это вместо этого выводит: < /p>
this
is
the
document
Подробнее здесь: https://stackoverflow.com/questions/494 ... n-python-r