Any character including newline - Java Regex

后端 未结 2 724
北荒
北荒 2020-11-27 05:01

I thought it may be [.\\n]+ but that doesn\'t seem to work?

2条回答
  •  野趣味
    野趣味 (楼主)
    2020-11-27 05:44

    Edit: While my original answer is technically correct, as ThorSummoner pointed out, it can be done more efficiently like so

    [\s\S]

    as compared to (.|\n) or (.|\n|\r)

提交回复
热议问题