有没有办法使用正则表达式将 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 但是你如何决定只在正则表达式中寻找换行符而不是空格?
谢谢您的帮助。