用于排除关键字集的正则表达式 [英] Regular Expression to exclude set of Keywords

查看:23
本文介绍了用于排除关键字集的正则表达式的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我想要一个表达式,当它遇到诸如boon.ini"和http"之类的词时会失败.目标是采用此表达式并能够为任何关键字集进行构造.

I want an expression that will fail when it encounters words such as "boon.ini" and "http". The goal would be to take this expression and be able to construct for any set of keywords.

推荐答案

^(?:(?!boon\.ini|http).)*$\r?\n?

(取自 RegexBuddy 的库)将匹配任何不包含 boon.ini 和/或http.这就是你想要的吗?

(taken from RegexBuddy's library) will match any line that does not contain boon.ini and/or http. Is that what you wanted?

这篇关于用于排除关键字集的正则表达式的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆