RegExLib.com - The first Regular Expression Library on the Web!

Please support RegExLib Sponsors

Sponsors

Regular Expression Details

Title Test Find Pattern Title
Expression
\d{1,3}[.]\d{1,3}[.]\d{1,3}[.]\d{1,3}\s.\s.\s\[\d{2}\/\D{3}\/\d{4}:\d{1,2}:\d{1,2}:\d{1,2}\s.\d{4}\]\s\"\S*\s\S*\s\S*\"\s\d{1,3}\s\S*\s\".*\"\s\".*\"
Description
This RegExp makes sure a line in a log file matches the Apache Common log format: LogFormat "%h %l %u %t \"%r\" %>s %b" common. It is not very strict on what appears in the 'page', 'referer' or 'agent' fields, as this text can vary massively, plus it keeps the RegExp as fast as possible... It was useful for me to check that logfiles on the server can be parsed by Log Analysis software I'm writing. I hope someone finds it useful.
Matches
65.93.238.74 - - [12/May/2005:12:37:11 -0400] "GET /dpstyle.css HTTP/1.1" 304 - "http
Non-Matches
Have found any yet...
Author Rating: The rating for this expression. rich hayes
Source
Your Rating
Bad Good

Enter New Comment

Title

Name

Comment

Spammers suck - we apologize. Please enter the text shown below to enable your comment (not case sensitive - try as many times as you need to if the first ones are too hard):

Existing User Comments

Title: Good
Name: Vladekk
Date: 1/25/2007 2:36:11 PM
Comment:
Works good, thanx


Copyright © 2001-2025, RegexAdvice.com | ASP.NET Tutorials