From: Gunther Diemant Date: 2011-03-11T23:58:19+09:00 Subject: Re: substitution in a regular expression --0016e64c25a82b7175049e36319e Content-Type: text/plain; charset=ISO-8859-1 Try a.gsub(/'?fecha'?\s*:\*[0-9\/]+/, "fecha: 01/03/2011"). 2011/3/11 Mario Ruiz > I want to replace the text for fecha on the string but I don't know how > to do it: > > a=" id:'name', > label :'Name', > type:'string', > idx : 3, > fecha: 24/13/2009, > whitelabel:'true', > fecha: 11/01/2009" > > > the regular expression I'm using is: > /'?fecha'? *: *'(.*)' *, *$/ > > and the result I want is: > a=" id:'name', > label :'Name', > type:'string', > idx : 3, > fecha: 01/03/2010, > whitelabel:'true', > fecha: 01/03/2010" > > -- > Posted via http://www.ruby-forum.com/. > > --0016e64c25a82b7175049e36319e--