首页 > 解决方案 > Notepad ++正则表达式在html代码中查找文件名

问题描述

我需要在 html 代码中搜索文件名。

要搜索的文本

D: \ Fitos \ excel \ ([1-9] [0-9] *) (. Xlsx “target =” _ top "> Old pdf)

用。。。来代替

D: \ Fitos \ excel2 \ $ 2 (.xlsx “target =” _ top "> Old Pdf) 

通过这个正则表达式搜索,我找到了 Excel 文件,例如 13037.xlsx

如果我想用正则表达式搜索文本 ES-00106.pdf 怎么办?

非常感谢您的帮助

标签: regexnotepad++filenames

解决方案


我认为正则表达式应该是:

D:\\Fitos\\excel\\([1-9][0-9]*)\.xlsx "target"="_top"> Old pdf

对于替换值,我认为您在使用第一个分组部分时需要 1 美元(整个正则表达式匹配为 0 美元),所以:

D:\Fitos\excel2\$1.xlsx "target"="_top"> Old pdf

推荐阅读