From: Jens Wille Date: 2008-04-30T23:34:22+09:00 Subject: Re: Search string for occurneces of words stored in array David A. Black [2008-04-30 16:29]: >> Jens Wille [2008-04-30 16:18]: >>> sentence =~ Regexp.union(*words) >> one addition regarding the regexp, though. in case words may >> contain special characters, it's safer to escape them first: >> >> sentence =~ Regexp.union(*words.map { |word| Regexp.escape(word) }) > It actually does it for you: > > Regexp.union("a",".b") => /a|\.b/ ha, didn't know that ;-) thank you!