What are you using for printing? I'm thinking about print $&

Care to paste some more of your code? :-)

jac

On Wed, 2004-05-05 at 11:23, Graeme McLaren wrote:
> jac, thank you for your reply.  I tried it and it didn't work, here is what 
> I have:
> 
> if($line =~ /(?<=Retrieval command for )http:.*?:/){
> 
> It prints off the "Retrieval command for" part as it did before :(
> 
> 
> any ideas?
> 
> 
> Cheers,
> 
> Graeme :)
> 
> 
> 
> >From: Jose Alves de Castro <[EMAIL PROTECTED]>
> >To: Graeme McLaren <[EMAIL PROTECTED]>
> >CC: [EMAIL PROTECTED]
> >Subject: Re: pattern match question
> >Date: 05 May 2004 11:09:19 +0100
> >MIME-Version: 1.0
> >Received: from onion.perl.org ([63.251.223.166]) by mc5-f36.hotmail.com 
> >with Microsoft SMTPSVC(5.0.2195.6824); Wed, 5 May 2004 03:13:03 -0700
> >Received: (qmail 16586 invoked by uid 1005); 5 May 2004 10:12:55 -0000
> >Received: (qmail 16551 invoked from network); 5 May 2004 10:12:54 -0000
> >Received: from x1.develooper.com (63.251.223.170)  by onion.develooper.com 
> >with SMTP; 5 May 2004 10:12:54 -0000
> >Received: (qmail 1039 invoked by uid 225); 5 May 2004 10:12:53 -0000
> >Received: (qmail 1028 invoked by alias); 5 May 2004 10:12:52 -0000
> >Received: from adslfixo-b3-123-25.telepac.pt (HELO metropolis.telbit.pt) 
> >(213.13.123.25)  by la.mx.develooper.com (qpsmtpd/0.27.1) with ESMTP; Wed, 
> >05 May 2004 03:12:50 -0700
> >Received: (qmail 32236 invoked from network); 5 May 2004 10:09:35 -0000
> >Received: from unknown (HELO [10.112.24.221]) ([192.168.89.253])          
> >(envelope-sender <[EMAIL PROTECTED]>)          by metropolis.telbit.pt 
> >(qmail-ldap-1.03) with SMTP          for <[EMAIL PROTECTED]>; 5 
> >May 2004 10:09:35 -0000
> >X-Message-Info: JGTYoYF78jHCcITVD+zs6qbFmOAlmrcH
> >Mailing-List: contact [EMAIL PROTECTED]; run by ezmlm
> >Precedence: bulk
> >List-Post: <mailto:[EMAIL PROTECTED]>
> >List-Help: <mailto:[EMAIL PROTECTED]>
> >List-Unsubscribe: <mailto:[EMAIL PROTECTED]>
> >List-Subscribe: <mailto:[EMAIL PROTECTED]>
> >Delivered-To: mailing list [EMAIL PROTECTED]
> >Delivered-To: [EMAIL PROTECTED]
> >X-Spam-Status: No, hits=0.2 required=7.0tests=NORMAL_HTTP_TO_IP
> >X-Spam-Check-By: la.mx.develooper.com
> >In-Reply-To: <[EMAIL PROTECTED]>
> >References: <[EMAIL PROTECTED]>
> >Organization: Message-Id: <[EMAIL PROTECTED]>
> >X-Mailer: Ximian Evolution 1.2.2 (1.2.2-4) X-Spam-Rating: 
> >onion.develooper.com 1.6.2 0/1000/N
> >Return-Path: [EMAIL PROTECTED]
> >X-OriginalArrivalTime: 05 May 2004 10:13:06.0035 (UTC) 
> >FILETIME=[8EC43C30:01C43289]
> >
> >I would do
> >
> >/(?<=Retrieval command for )http:.*?:/
> >
> >The "Retrieval" part now is contained in a "Look behind section", which
> >is to mean it's not going to be stored as part of the match.
> >
> >I'm not sure what other cases you can get in that log file, but this
> >solves the problem for that particular line you send in.
> >
> >HTH,
> >
> >jac
> >
> >On Wed, 2004-05-05 at 10:28, Graeme McLaren wrote:
> > > Hi, I'm trying to build a regular expression. to match a URL from a 
> >logfile.
> > >   In the logfile an example of the pattern I'm trying to match is:
> > >
> > > 12:12:1:http://10.2.203.1/missing1.html: Retrieval command for
> > > http://10.2.203.1/missing1.html: GET /missing1.html HTTP/1.0
> > >
> > >
> > > so far I've got:
> > >
> > > =~ /^.*?Retrieval\scommand\sfor\shttp:\/\/.*?\/.*?\..*\:/
> > >
> > > I can't seem to get it to match the end of the URL which ends with a ":"
> > >
> > > Also I don't want to display "Retrieval command for" when retrieving a
> > > match, just the URL, how would I do that?
> > >
> > >
> > >
> > > Thanks in advance for any help
> > >
> > >
> > > Graeme :0
> > >
> > > _________________________________________________________________
> > > Express yourself with cool new emoticons 
> >http://www.msn.co.uk/specials/myemo
> >--
> >Josà Alves de Castro <[EMAIL PROTECTED]>
> >Telbit - Tecnologias de InformaÃÃo
> >
> >
> >--
> >To unsubscribe, e-mail: [EMAIL PROTECTED]
> >For additional commands, e-mail: [EMAIL PROTECTED]
> ><http://learn.perl.org/> <http://learn.perl.org/first-response>
> >
> >
> 
> _________________________________________________________________
> Use MSN Messenger to send music and pics to your friends 
> http://www.msn.co.uk/messenger
-- 
Josà Alves de Castro <[EMAIL PROTECTED]>
Telbit - Tecnologias de InformaÃÃo


-- 
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
<http://learn.perl.org/> <http://learn.perl.org/first-response>


Reply via email to