From: Clemens Wyss Date: 2009-05-14T20:48:31+09:00 Subject: Re: Regexp simple, but for sure not perfect: /(?:.*?\.)*(.*?monday.*?)\./.match()[1] e.g.: /(?:.*?\.)*(.*?monday.*?)\./.match('asdasd . asdas dasd .it is monday morning. hello world')[1] => "it is monday morning" Regards Clemens Mikael Bjæ—¦rkegren wrote: > Hello! > > Anyone who can help me with this. If i have a string and want to take > out a sub string of that by regexp. > > 1. string = "Today is it monday after work. blah blah." > or > 2. string2 = "monday morning. Nice day today." > > And i would like to get a certain line with the word monday in it. > Like results below. > > 1. result = "Today is it monday after work" > 2. result2 = "monday morning" > > Thanks > Svea -- Posted via http://www.ruby-forum.com/.