小编Agu*_*s P的帖子

正则表达式除了特定的单词

我有正则表达式的问题.除了一组指定的单词外,我需要制作正则表达式,例如:apple,orange,juice.并且给出这些词语,它将匹配除上述词语之外的所有内容.

applejuice (match)
yummyjuice (match)
yummy-apple-juice (match)
orangeapplejuice (match)
orange-apple-juice (match)
apple-orange-aple (match)
juice-juice-juice (match)
orange-juice (match)

apple (should not match)
orange (should not match)
juice (should not match)
Run Code Online (Sandbox Code Playgroud)

regex exception cpu-word

6
推荐指数
2
解决办法
3万
查看次数

标签 统计

cpu-word ×1

exception ×1

regex ×1