Exclude characters

Use ^ inside [] to exclude. Note a-z will work and a - must be at the start of the end to match a literal -.

[^\w-]

Exclude words

Source: regextester

^((?!badword).)*$
badword
test      # match
one two   # match
abadwords
three     # match

Multiple exclusions:

?!(foo|bar)

?!(http|[{#])