From: sto.mar@...
Date: 2012-11-09T15:09:48+09:00
Subject: Re: Ruby script to process html
Am 09.11.2012 03:28, schrieb Mario Trento:
> Or maybe you have a hint how to extract value between
... | ,
>
> Tx
> Dai
>
Depending on the formatting etc. of the real data, this could
get pretty difficult, but for your simple example data
iterating over the lines and using a regular expression
(with a named capture group) would work:
1.9.3-p194 :001 > /(?.*?)<\/tr>/ =~ ' Test
'
=> 2
1.9.3-p194 :002 > value
=> "Test"
But it certainly is not the "most cool way" and will break when
the html is formatted differently, like e.g.
| ... | ... | ... |
or
| ... |
...
--