使用此(?sm)^.*?\.$
我从文本中检索每个段落。
如果文本末尾有“空格”,则最后一段不匹配。我需要用什么来解决这个问题?
示例文字:
Copyright laws are changing all over the world. Be sure to check the
copyright laws for your country before downloading or redistributing
this or any other Project Gutenberg eBook.
This header should be the first thing seen when viewing this Project
Gutenberg file. Please do not remove it.
Please read the "legal small print", and other information about the
eBook and Project Gutenberg at the bottom of this file.
答案 0 :(得分:4)
答案 1 :(得分:2)