我想改变这种形式的行:
one line find text
Run Code Online (Sandbox Code Playgroud)
插入一对这种形式的行:
first line of replace text
second line of replace text
Run Code Online (Sandbox Code Playgroud)
\n我知道可以通过选中“使用正则表达式匹配”框并填写“查找”框来搜索换行符。但\n在“替换为”框中似乎插入\n到了结果中,而不是所需的换行符。
我尝试使用此搜索和替换,但它对我不起作用:
Find `one line of find text`
Replace with `first line of replace text\nsecond line of replace text`
Run Code Online (Sandbox Code Playgroud)
我的下一个策略是在“查找”框中使用带括号的正则表达式和“$替换为”框中的 [number] 表达式的正则表达式匹配结构,但这对我来说也不起作用:
Find `(\n)one line of find text`
Replace with `$1first line of replace text$1second line of replace text`
Run Code Online (Sandbox Code Playgroud)
有没有办法在 Google 文档中执行此操作,或者我必须导出到功能更强大的文字处理程序(例如Word或Libre Office),在那里进行查找和替换,然后导入回 Google 文档?
注 1:我描述的是截至 2019 年 7 月的 Google …
google-docs ×1