J
Jayme Assuncao Casimiro
I have this piece of html text from Amazon.com
<dt><b><a
href="/exec/obidos/ASIN/0965761762/qid=917872216/sr=1-1/002-1496444-0064804">1
Business, 2 Approaches : How to Succeed in Internet Business by Employing
Real-World Strategies</a></b>
~ <NOBR><font color=#990033>Usually ships in 2-3 days</font></NOBR><dd>
Ron Gielgun / Hardcover / Published 1998
<br>
Our Price: $13.97 ~ <NOBR><font color =#990033>You Save: $5.98
(30%)</font></NOBR>
<br>
<a
href="/exec/obidos/ASIN/0965761762/qid=917872216/sr=1-1/002-1496444-0064804"><i>Read
more about this title...</i></a>
<p>
And I would like to use only one regexp to extract the title, the price,
and the desconunt in percent.
On the above example it would be:
title = 1 Business, 2 Approaches : How to Succeed in Internet Business byEmploying
Real-World Strategies
Price = $13.97
Descount = 30%
I have used:
($title) = $_ =~ m{<a.*?>(.*?)</a>};
($price) = $_ =~ m{.*Our Price:\s(\$?[\d\,.]+)};
($descount) = $_ =~ m{.*You Save:.*?[\d\,.]+.*?([\d\,.]+)};
But I would like to use only one regexp.
Thanks
+---------------------------------------------+
| Jayme Assuncao Casimiro |
| Graduado em Ciência da Computação |
| Estudante de Mestrado em Computação |
| Universidade Federal de Minas Gerais - UFMG |
+---------------------------------------------+
<dt><b><a
href="/exec/obidos/ASIN/0965761762/qid=917872216/sr=1-1/002-1496444-0064804">1
Business, 2 Approaches : How to Succeed in Internet Business by Employing
Real-World Strategies</a></b>
~ <NOBR><font color=#990033>Usually ships in 2-3 days</font></NOBR><dd>
Ron Gielgun / Hardcover / Published 1998
<br>
Our Price: $13.97 ~ <NOBR><font color =#990033>You Save: $5.98
(30%)</font></NOBR>
<br>
<a
href="/exec/obidos/ASIN/0965761762/qid=917872216/sr=1-1/002-1496444-0064804"><i>Read
more about this title...</i></a>
<p>
And I would like to use only one regexp to extract the title, the price,
and the desconunt in percent.
On the above example it would be:
title = 1 Business, 2 Approaches : How to Succeed in Internet Business byEmploying
Real-World Strategies
Price = $13.97
Descount = 30%
I have used:
($title) = $_ =~ m{<a.*?>(.*?)</a>};
($price) = $_ =~ m{.*Our Price:\s(\$?[\d\,.]+)};
($descount) = $_ =~ m{.*You Save:.*?[\d\,.]+.*?([\d\,.]+)};
But I would like to use only one regexp.
Thanks
+---------------------------------------------+
| Jayme Assuncao Casimiro |
| Graduado em Ciência da Computação |
| Estudante de Mestrado em Computação |
| Universidade Federal de Minas Gerais - UFMG |
+---------------------------------------------+