Check if the string is alphabetic and does not contain some specific words

I use /^[a-zA-Z]+$/ to check if the string is alphabetic and /^((?!some|words|in|blacklist).)*$/ to check if it contains certain words.

How to check both conditions in one regex pattern?

+5
source share
1 answer

Using

 /^(?!some|words|in|blacklist)[a-zA-Z]+$/ 
+6
source

All Articles