我有一个正则表达式,它匹配不以“DEF”开头的单词。
现在我想将其修改为以下三种情况:
我应该修改字符串模式?
Regex pattern Match word which does NOT start with word "DEF": ^(?!DEF).*$
match word : ADEFCCC
Does Not Match : DEFXXX
Run Code Online (Sandbox Code Playgroud)
Does not end with DEF: ^.*(?<!DEF)$
Does not contain DEF: ^((?!DEF).)*$
Does not equal DEF: ^(?!DEF$).*$
Run Code Online (Sandbox Code Playgroud)