Try a.gsub(/'?fecha'?\s*:\*[0-9\/]+/, "fecha: 01/03/2011").


2011/3/11 Mario Ruiz <tcblues / gmail.com>

> 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/.
>
>