开发者

Regex match everything but

开发者 https://www.devze.com 2023-01-16 07:03 出处:网络
I would like to create a regular expression to match every word, whitespace, punctuation and special characters in a string except for specific keywords or phrases. Because I only can modify regex, no

I would like to create a regular expression to match every word, whitespace, punctuation and special characters in a string except for specific keywords or phrases. Because I only can modify regex, not server code I have to use match instead of replace.

I have something like this so far: (?!(quick|b开发者_如何学JAVArown|fox|the lazy))\b\w+ but it ignores white spaces and special characters in this tool

Thanks.


Does this work for you (?!(quick|brown|fox|the lazy))(\b\w+|[^\w])?

Do you have any examples?

0

精彩评论

暂无评论...
验证码 换一张
取 消

关注公众号