From: Jari Williamsson Date: 2008-03-01T04:19:34+09:00 Subject: Re: Need a regex searching html code Mark Thomas wrote: > All the regex solutions provided will break with the following > perfectly valid HTML: > >
>
Tagline:
> Yippee Ki Yay Mo - John 6:27 >
> > This is one of many reasons it is a BAD idea to use regexes to parse > HTML. Regular expressions are simply not the right tool for the job. Sorry if I'm missing the point: --- the_text = %q{
Tagline:
Yippee Ki Yay Mo - John 6:27
} the_text.each_line do |line| puts "Within DIV tags: #{line}" if (line=~/
Within DIV tags:
Tagline:
Within H5 tags:
Tagline:
Within DIV tags: Yippee Ki Yay Mo - John 6:27 Within DIV tags:
Best regards, Jari Williamsson