From: Fred VD Date: 2006-07-07T19:44:23+09:00 Subject: Regexp Hello, I'm new to Ruby and I'm fighting with regexp. I would like to replace 'test1<\math>' and 'test2<\math>' by 'ok' in the string "blabla1 blabla1 test1<\math> blabla2 blabla2 test2<\math>" When I try this : @a = "blabla1 blabla1 test1<\math> blabla2 blabla2 test2<\math>" @b = @a.gsub(/.+<\math>/,'ok') I get "blabla1 blabla1 ok" instead of "blabla1 blabla1 ok blabla2 blabla2 ok" Could you please help me to tune my regexp so it works the way I want ? Thank you in advance, Fred. -- Posted via http://www.ruby-forum.com/.