Hal Fulton wrote: > James Edward Gray II wrote: >> On Nov 26, 2004, at 3:20 PM, Hal Fulton wrote: >> >>> Maybe something like text.split.include?(word) >> >> Yeah, that's probably better, if a little less efficient (I assume). > > Probably is less efficient. > > Also it's not quite right, as it doesn't ignore punctuation. What about ALL_WORDS = /\b[^\s.,:;_!?\/&()"-]+\b/ text.scan(ALL_WORDS).map{|x| x.downcase}.include?(word) Even less efficient, but I guess it does always work. Markus