RegEx

RegEx 选中除特定字符串外的所有行

如果想选中除了包含 red, green, blue 这三个单词之外的所有行,可使用如下正则表达式:

^(?!.*(red|green|blue))

如果想选中(不含 red, green, 或 blue)、但是(包含 engine)的所有行,表达式如下:

^(?!.*(red|green|blue)).*engine

参见 stackoverflow 上对此的讨论

Derek Yang

生于湖南,先后在北京和广东学习与工作。2013年移居美国。EB-1 职业移民。非移民律师、非移民中介。Twitter @mrderekyang

Disclosure: We are an Amazon Associate. Some links on this website are affiliate links, which means we may earn a commission or receive a referral fee when you sign up or make a purchase through those links.

相关文章

没找到您想要的信息?
请使用我们强大的搜索工具!

Comments

Leave a Reply

This site uses Akismet to reduce spam. Learn how your comment data is processed.

Stock images sponsored by depositphotos.com