记事本++正则表达式反向引用丢失
我有这个 HTML 部分:
<a href="http://always-same-path.to/my/file.pdf">Random reference</a>
这一行存在于很多文件中。
我需要将其替换为:
Random reference <lots>of tags</lots>
通常的正则表达式(Ctrl + F)效果很好。不幸的是,替换文本太长,无法在通常的正则表达式中使用,因此我使用了 TextFX 的高级搜索和替换插件。
这是我的发现:
<a href="http://always-same-path.to/my/file.pdf">(.+)</a>
这是我的替换:
\1 <lots>of tags</lots>
查找作品(即该行突出显示) 然而,更换则不然。 我得到这个:
<lots>of tags</lots>
这些选项在“查找/替换”窗口中检查:
- Regular Expr
- Autograb Find Text
- Wrap
提前致谢
I have this HTML part :
<a href="http://always-same-path.to/my/file.pdf">Random reference</a>
This line exists in a lot of files.
I need to replace it with :
Random reference <lots>of tags</lots>
The usual regex (Ctrl + F) works well. Unfortunately, the replacement text is way too long and can't be used in the usual regex, so I used TextFX's advanced Search and replace plugin.
This is my find:
<a href="http://always-same-path.to/my/file.pdf">(.+)</a>
This is my replace:
\1 <lots>of tags</lots>
Finding works (i.e. the line is highlighted)
Replacing, however, doesn't.
I get this instead :
<lots>of tags</lots>
Those options are checked in the Find/replace window:
- Regular Expr
- Autograb Find Text
- Wrap
Thanks in advance
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
对我来说同样的问题,但已解决!
我刚刚在替换字段
$0
中使用,它起作用了!我的 Notepad++ 版本:v6.1.5 UNICODE(刚刚更新! - 我建议您也这样做)
我正在处理的文件格式:
.srt
(电影字幕)“查找内容”字段:< code>^\d+$ [仅包含数字的匹配行]
“替换为”字段:
----- $0 ------
Same issue for me, but resolved!
I just used in the replace field
$0
and it worked !My Notepad++ version: v6.1.5 UNICODE (just updated! - I would suggest you to do the same)
File format I'm working on:
.srt
(movie subtitles)"Find What" field:
^\d+$
[matching line with just a number]"Replace with" field:
----- $0 ------