----- Original Message -----
From: "Stefan Lidman" <[EMAIL PROTECTED]>
To: <[EMAIL PROTECTED]>
Sent: Sunday, February 23, 2003 3:17 PM
Subject: Re: Stupid regex.. I'm going to kick myself...
> > while (<>) {
> > if ($_ =~ /LinkArea="MoreHeadlines">/) {
> > ($URL) = $_ =~ /href="($.)"/;
> > print "$URL\n";
> > }
> > }
> >
> > I have a URL...
> >
> > <a id="something" href="something" target="something"
> > LinkArea="MoreHeadlines">test</a>
> >
> > Everything is randomly generated. Hence, I want to extract anything
> > specified in the href="" field... So, after doing extensive reading, I
found
> > that I am indeed looking for /href="($.)"/ However, I cannot seem to
> > extract this into a separated variable...
>
> try: ($URL) = /href="(.*?)"/;
>
> /Stefan
Hmmm... Now it only prints a 1
I did check and confirm if my regex is right and all... if ($_ =~ /href="/)
returns true... So it does find it.. It just doesn't want to extract it for
some reason.
Various perl docs / faqs online (google is my friend), suggested something
like this...
/href="($.)"/; #<-- Shoot me if I know where the regex is supposed to get
the data from to parse...
$URL = $1;
print $URL;
But even that screws up. $1 is a empty value....
--
me
--
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]