String to check:
As it turns out, our potential shipmates are extremely superstitious. As such, we do not want anyone to enter certain words in their comments.
Requirements:
1. Let's start checking for bad words within a sentence. We can begin with 'sink'
as our first bad word. We will want to make sure this word is by itself and not part of a larger word.
/sink/gim
2. Looking good, but there are more bad words we need to account for. Let's also check for 'wreck'
.
/(sink|wreck)/gim
3. Almost finished. Our final bad word to match is 'disaster'
.
/(sink|wreck|disaster)/gim
-------------------------------------
/http(s)?://(www.)?twitter(.com|.org)/codeschool/gm