A
Anthony Walsh
I'm new to Ruby and trying to use regular expressions to parse an html
file. The page is a large table with no spaces in the html code. I want
to count the number of times <tr> or <tr 'anything'> occurs. I'm stuck
on trying to match every variety of <tr>
I've tried
op_file = File.read(htmlfile)
if op_file =~ /(<tr(.*?)>)+/
but it catches the first <tr and matches all the way to the end of the
file. Anyone have any advice on matching and counting?
-Shinkaku
file. The page is a large table with no spaces in the html code. I want
to count the number of times <tr> or <tr 'anything'> occurs. I'm stuck
on trying to match every variety of <tr>
I've tried
op_file = File.read(htmlfile)
if op_file =~ /(<tr(.*?)>)+/
but it catches the first <tr and matches all the way to the end of the
file. Anyone have any advice on matching and counting?
-Shinkaku