From: GianFranco Bozzetti Date: 2010-10-20T00:45:18+09:00 Subject: Re: Find block in a long string Does this snippet solve your need? # Given the string: str="<p>\n <strong>Location:</strong> Columbus, Ohio\n</p>\n\n<" # remove unwanted chars with: str1=str.gsub(/[&\/;\n]+|lt|gt|strong|p/im,' ').strip.squeeze(' ') # and obtain; puts "str1: #{str1}" #=> Location: Columbus, Ohio # if you wish, remove Location: and obtain; str2 = str1.gsub(/Location:\s+/i,'') puts "str2: #{str2}" #=> Columbus, Ohio HTH gfb "Greg Ma" wrote in message news:14b91fa99bddaa2bd5b39c486fd8d1ce@ruby-forum.com... > Steel Steel wrote in post #955407: >> Ruby has an RSS parser isn't it? Why not use it? >> >> http://ruby-doc.org/core/classes/RSS.html >> http://www.cozmixng.org/~rwiki/?cmd=view;name=RSS+Parser%3A%3ATutorial.en > > I do use a rss parser. The rss parser was just here to explain what I am > doing, but it has no relation with my issue. > > -- > Posted via http://www.ruby-forum.com/. >