有这样的东西
<foo@boo.com>foo@boo.com
<info@foo2.com>info@foo2.com
我想选择整个脚本中每个 <> 之间的所有文本,并将其替换为确定的值。我还想省略所有不在 <> 之间的文本不受影响。
尝试使用此表达式 <.*> 但随后整个脚本被选中,包括不在 <> 之间的文本
(?<=<).+?(?=>)New_value. matches newline解释:
(?<=<) # positive lookbehind, make sure we have "<" before
.+? # 1 or more any character but newline
(?=>) # positive lookahead, make sure we have ">" after
Run Code Online (Sandbox Code Playgroud)
屏幕截图:
| 归档时间: |
|
| 查看次数: |
20864 次 |
| 最近记录: |