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>


Reply via email to