我有 1000 个 html 页面,我想查找所有具有重复标签(“og:title”)的页面,例如:
<meta property="og:title" content="BLAH BLAH" />
ETC...
ETC...
<meta property="og:title" content="Elvis Presley" />
有人能帮忙提供一个好的正则表达式吗?
答案1
- Ctrl+F
- 找什么:
(property="og:title)[\s\S]*\1"
- 检查正则表达式
- Search in document
解释:
(property="og:title") : group 1, must contain literally property="og:title"
[\s\S]* : 0 or more any character (i.e. space OR not space)
\1 : reference to group 1, must contain literally property="og:title"