Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
我有一个正则表达式,它匹配不以“DEF”开头的单词。
现在我想将其修改为以下三种情况:
我应该如何修改字符串模式?
Regex pattern Match word which does NOT start with word "DEF": ^(?!DEF).*$ match word : ADEFCCC Does Not Match : DEFXXX
Does not end with DEF: ^.*(?<!DEF)$ Does not contain DEF: ^((?!DEF).)*$ Does not equal DEF: ^(?!DEF$).*$