Skip to content

Instantly share code, notes, and snippets.

@donatj
Created August 31, 2010 15:23
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save donatj/559190 to your computer and use it in GitHub Desktop.
Save donatj/559190 to your computer and use it in GitHub Desktop.
Useful Regular Expressions
(?<ip>\d{1,3}\.\d{1,3}\.\d{1,3}\.\d{1,3}) - - \[(?<timestamp>.*?)\] "GET (?<request>.*?) (?<httpver>HTTP/1\.\d)" (?<response>\d{3}) (?<response_size>\d{1,}) "(?<referer>.*?)" "(?<client>.*?)"
[0-9a-f]{40} [0-9a-f]{40} (?<name>.*?) <(?<email>.*?)> (?<time>[0-9]*) (?<timezone>[\+\-][0-9]*)\t(?<action>.*?): (?<message>.*)
(?<address>\d+ .*?)(\n|\r|,|-)+(((?<address2>.*?)(\n|\r|,){1,})??)(?<city>.*?)(,| )+(?<state>\w*)(\n|\r|,| )+(?<zipcode>\d{5}-?\d{0,4})
@donatj
Copy link
Author

donatj commented Aug 31, 2010

Address 2 can be off sometimes, but otherwise it works perfect

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment