【发布时间】:2021-01-10 00:41:52
【问题描述】:
我尝试过使用[\s]+$ 和(?:$|\s)+$,但没有得到想要的输出。
我要找的是
String str ="this is a string ending with multiple newlines\n\n\n"
新行可以是:\n 或 \r 或 \r\n,具体取决于操作系统,因此我们在此处使用 \s+。
我需要从字符串末尾找到所有换行符 我必须在 Java 代码中使用它
【问题讨论】:
标签: java regex regex-group