如何使用RegEx替换Notepad ++中的HTML代码 [英] How can I replace HTML code in Notepad++ using RegEx
问题描述
我有很多php页面。每个php页面都有一个这样的字符串:
< FONT COLOR =#0000FF>发布ID:16107< / FONT>
我想用以下内容替换:
< A HREF =#16107>发帖ID:16107< / A>
但是由于每个php页面都有不同的Post ID,我想匹配每个出现的字符串......我通常使用notepad2女巫支持正则表达式和记事本+ +也支持正则表达式。我怎样才能将所有字符串替换为所有文件夹中的所有文件?大约350个文件...
替换: I have a lot of php pages. Every php page has inside a string like this: and I'd like to replace with: but since every php page has a different Post ID and I'd like to match every occurrence of the string... I use as usually notepad2 witch supports regex and notepad++ too that supports regex as well. How can I replace all strings into all files into all dirs? Are about 350 files... Replace: With: 这篇关于如何使用RegEx替换Notepad ++中的HTML代码的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!< FONT COLOR =。*?>(Post ID:([0-9] +))< / FONT> $ b
< A HREF =#\2> \1< / A>
<FONT COLOR="#0000FF">Post ID: 16107</FONT>
<A HREF="#16107">Post ID: 16107</A>
<FONT COLOR=".*?">(Post ID: ([0-9]+))</FONT>
<A HREF="#\2">\1</A>