Re: regexp

From: Gunnar Hjalmarsson (noreply_at_gunnar.cc)
Date: 01/30/04


Date: Fri, 30 Jan 2004 17:28:14 +0100

Jayme Assuncao Casimiro wrote:
> 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.

So, what stops you?

     ($title, $price, $discount) = m{...};
------------------------------------^^^
(to be filles with the regex)

-- 
Gunnar Hjalmarsson
Email: http://www.gunnar.cc/cgi-bin/contact.pl