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

Please support RegExLib Sponsors

Sponsors

Expressions by User

   Displaying page 1 of 1 pages; Items 1 to 1
Title Test Details 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
   Displaying page 1 of 1 pages; Items 1 to 1

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