如何使用记事本 plus plus 中的正则表达式检查 html 标签之间的值是否为空或为空
我正在 notepad++ 中对文件进行大量搜索,我需要确定一组标签之间是否没有值(即 )。
“.*?”将搜索 0 个或多个字符(好吧,大多数),这很好。但我正在寻找一组标签,它们之间至少有一个字符。
“.+?”与上面类似,并且可以在 notepad++ 中运行。
我尝试了以下方法,但没有成功:
<author>.{0}?</author>
谢谢您的帮助。
I'm conducting a mass search of files in notepad++ and I need to determine if there are no values between a set of tags (i.e. ).
".*?" will search for 0 or more characters (well, most), which is fine. But I'm looking for a set of tags with at least one character between them.
".+?" is similar to the above and does work in notepad++.
I tried the following, which was unsuccessful:
<author>.{0}?</author>
Thank you for any help.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
既然你寻找的是不存在的东西,你就不必把它搞得那么复杂。只需搜索
就可以解决问题,不是吗?如果您想将空格字符包含为“无”,您可以将其修改为以下内容:输出:
Since you look for something that doesn't exist you don't have to make it that complicated. Simply searching for
<author></author>
would do the trick, wouldn't it? If you want to include space-characters as "nothing" you could modify it to the following:Output:
我不明白你为什么用“?”操作员; “.+”应该会产生您需要的结果。
I don't understand why you are using the "?" operator; ".+" should yield the result you need.