From: Robert Klemme Date: 2007-04-09T23:25:13+09:00 Subject: Re: regexp -how to match this? On 09.04.2007 15:28, Nanyang Zhan wrote: > what kind of pattern will match the part of sentence before a > tag? > > for instance: > for this sentence: > This forum is connected to a mailing list that is read by class="wow">thousands of people. > > it'll match: > This forum is connected to a mailing list that is read by One way to do it: irb(main):022:0* s='This forum is connected to a mailing list that is read by thousands of people.' => "This forum is connected to a mailing list that is read by thousands of people." irb(main):024:0> s[/\A(.*?) "This forum is connected to a mailing list that is read by " robert