Re: Stupid regex.. I'm going to kick myself...

2003-02-23 Thread R. Joseph Newton
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 = $_) =~

Re: Stupid regex.. I'm going to kick myself...

2003-02-23 Thread R. Joseph Newton
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...

Re: Stupid regex.. I'm going to kick myself...

2003-02-23 Thread Chris Knipe
> > 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

Re: Stupid regex.. I'm going to kick myself...

2003-02-23 Thread Stefan Lidman
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 >

Re: Stupid regex.. I'm going to kick myself...

2003-02-23 Thread Chris Knipe
- 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="

Re: Stupid regex.. I'm going to kick myself...

2003-02-23 Thread John Baker
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

Re: Stupid regex.. I'm going to kick myself...

2003-02-23 Thread Stefan Lidman
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