- word!
- word?
- word,
- word.
- word;
- word:
- word/
- word\
If you want to block the words above, you may use the following regular expression:
\bWORD[!,;:\./?]+\b
where:
b | (in the beginning and end) means word boundary or whole word matching. This is different from \s, which matches a white space. |
WORD | is the target word. IMSS is not case sensitive by default so it will match any combination of uppercase and lowercase letters. |
[!,;:\./?] | is the bracket that contains choices of characters specifically punctuations. Regex will match anything that is inside [ ]. [ ] represents only one character. |
+ | means any number of the preceding character (that means those inside the [ ]) |