Asp Forum
Home
|
Login
|
Register
|
Search
Forums
>
comp.lang.ruby
Re: parsing HTML code with regex
Gavin Kistner
10/24/2006 6:48:00 PM
From: Anthony Walsh
> Sent: Tuesday, October 24, 2006 12:35 PM
> I'm trying to count and print each <tr> and <tr 'something'>.
Do you just want to match the "<tr>", or do you want to match the
"<tr>...</tr>"?
Assuming the former:
row_tags = op_file.scan( /<tr[^>]+>/ )
p row_tags, row_tags.length
>
> I haven't even gotten to counting my matches. I'm still working on
> matching with <tr> or <tr 'anything'>
>
> I've done:
>
> op_file = HTML_CODE
> if op_file =~ /(<tr(.*?)>)+/
>
> but it catches everything on from the first <tr to the end of
> the line.
> Any ideas?
>
> -Shinkaku
>
> --
> Posted via
http://www.ruby-...
.
>
>
Servizio di avviso nuovi messaggi
Ricevi direttamente nella tua mail i nuovi messaggi per
Re: parsing HTML code with regex
Inserendo la tua e-mail nella casella sotto, riceverai un avviso tramite posta elettronica ogni volta che il motore di ricerca troverà un nuovo messaggio per te
Il servizio è completamente GRATUITO!
x
Login to ForumsZone
Login with Google
Login with E-Mail & Password