【发布时间】:2013-07-09 11:32:22
【问题描述】:
有没有办法使用正则表达式将txt文件分成段落?
例如,如果这是我的文本文件:
They call for you: The general who became a slave; the slave who became a gladiator; the gladiator who defied an Emperor. Striking story.
Watch your thoughts, for they will become actions. Watch your actions, for they'll become...habits. Watch your habits for they will forge your character. Watch your character, for it will make your destiny.
我希望这里涉及到 \s,但是您如何决定只在正则表达式中查找换行符而不是空格?
感谢您的帮助。
【问题讨论】: