From: Mike Dalessio Date: 2009-12-16T01:58:39+09:00 Subject: Re: regexp to pars a HTML tag value --00151757688c138df1047ac733b7 Content-Type: text/plain; charset=ISO-8859-1 On Tue, Dec 15, 2009 at 11:10 AM, Marnen Laibow-Koser wrote: > Mehdi Karamnejad wrote: > > I want to replace the value inside a HTML tag with another value using > > gsub function and regexp,what is the best regexp for this purpose? > > puts MyStr.gsub(/"What Should Be the Regex?"/, "NewValue") > > example: > > > If you expect any complexity at all in the structure of the HTML, then > regexes will be inadequate and you'll need to use a parser such as > Nokogiri. > > > Best, > -- > Marnen Laibow-Koser > http://www.marnen.org > marnen@marnen.org > -- > Posted via http://www.ruby-forum.com/. > > -- mike dalessio mike@csa.net --00151757688c138df1047ac733b7--