Yes, it is very possible. You need to learn something about Regular Expressions.
aka RegEx and RegExp. There are thousands of tutorials when you search google.
inpStr="The quick brown fox jumps over the lazy dog and feels as if he were in the seventh heaven. Why does it jump quick over a dog?"
rAry=new Array("and feels","quick");
And yes, Google is my friend. I tried your code, and it works. However it only works on the text you declare in the var and spits it out without whatever has been specified. What If I wanted the script to scan a page which all ready has the text on it. I.E scan the page and delete/replace certain words.