Sorry--my earlier response went out just as I noticed that it was incomplete. The
changes below should do it.
Joseph
Chris Knipe wrote:
> Lo all,
>
> I'm doing something *really* stupid... Please kick me...
>
> while (<>) {
> if ($_ =~ /LinkArea="MoreHeadlines">/) {
> ($URL = $_) =~
Hi Chris,
Try the chage shown inline
Joseph
Chris Knipe wrote:
> Lo all,
>
> I'm doing something *really* stupid... Please kick me...
>
> while (<>) {
> if ($_ =~ /LinkArea="MoreHeadlines">/) {
> ($URL = $_) =~ s/href=\"(.*?)\"/;
> print "$URL\n";
> }
> }
>
> I have a URL...
>
> try: ($URL) = /href="(.*?)"/;
>
Not sure what I did the first time... But it works the second time...
while (<>) {
if (($_ =~ /^/i)) {
($URL) = /href="(.*?)"/;
print "$URL\n";
}
}
Thanks Stefan... Much appreciated.
--
me
--
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additi
John Baker wrote:
>
> To match one href key/value pairs per line:
>
> while (<>) {
> if (/LinkArea=\"MoreHeadlines\"\>/) {
> print "$1\n", if (/href\=\"(\w+)\"\s/);
\w is [a-zA-Z_0-9] but respects use locale, and will not match
if there is a : or / or . between the ""
/Stefan
>
- 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="
To match one href key/value pairs per line:
while (<>) {
if (/LinkArea=\"MoreHeadlines\"\>/) {
print "$1\n", if (/href\=\"(\w+)\"\s/);
}
}
...though this does assume that you'd only have one
href key and value per line after the "MoreHeadlines"
match. If it's possible to have mult
Chris Knipe wrote:
>
> Lo all,
>
> I'm doing something *really* stupid... Please kick me...
>
> while (<>) {
> if ($_ =~ /LinkArea="MoreHeadlines">/) {
> ($URL) = $_ =~ /href="($.)"/;
> print "$URL\n";
> }
> }
>
> I have a URL...
>
> LinkArea="MoreHeadlines">test
>
> Ever