From: Phrogz Date: 2009-10-09T22:10:06+09:00 Subject: Re: Making one reg ex out of two On Oct 9, 6:46 am, Jim Burgess wrote: > course_info = > "10.10.09Maths" > > I want to use a reg ex to extract the title from the string, in this > case "Maths" Slim2:~ phrogz$ irb irb(main):001:0> course_info = "10.10.09Maths" => "10.10.09Maths" irb(main):002:0> course_info[ /([^<]+)/, 1 ] => "Maths" irb(main):003:0> %r{<title>(.+?)}.match(course_info).to_a => ["Maths", "Maths"]