我正在使用文本编辑器,它使用regular expression
来查找/替换文本。我有一个很大的文本文件。我想在每个超过30个字符的行中插入新行。我希望线条在30个字符后断开(如果一个单词/短语不成立,则无关紧要)。如何编写RegEx插入行长超过30个字符的换行符?
例子:
原始文本:
Hi this is a sample text.
this is a line.
This is a very very very very very long line.
This is a regular line.
....
修改后的文本:
Hi this is a sample text.
this is a line.
This is one very very very ver
y very long line.
This is a regular line.
....
现在,我怎么能写regular expression
换
- 找出超过30个字符的行。
- 在长度超过30个字符的行的第30个字符后面插入新行。
哪种编程语言? – Dreamweaver