From: "Jesús Gabriel y Galán" Date: 2010-03-12T19:52:51+09:00 Subject: Re: how to get word from sentence On Fri, Mar 12, 2010 at 11:48 AM, Rajkumar Surabhi wrote: > Hi all, > In my application i have to get the word which contains given word. > example > sentence: iam testung the aplication > i want to extract the word which starts with test > how to do this You can do it with a regular expression. Here is an example: irb(main):001:0> s = "i am testing the app" => "i am testing the app" irb(main):004:0> s[/\btest\w*/] => "testing" \b --> word boundary \w --> word character Jesus.