From: Marc Heiler Date: 2012-04-10T19:08:37+09:00 Subject: Re: need to match words from setence sentence = "this is important information" if sentence.include? 'important' # do something here end You could use a regex too: if sentence =~ /important/ Within your if code blocks, you can check which combinations to use or avoid. sentence = "this is &@important,^% information" this should not match if sentence.include? '^' # Dont match here end This is really very basic if / else conditionals. Look at an easy ruby tutorial if this confuses you, it is really the basic of any programming language how to use if / else. http://pine.fm/LearnToProgram/?Chapter=00 Work through this book at least once, then you know how to use if / else and .include?. If you need a regex: http://rubular.com/ But also read a tutorial what the meaning is of a regex. You can probably make a one liner regex that matches to impotant, but not if it includes a "^" -- Posted via http://www.ruby-forum.com/.