nix, shell, perl, php, mysql and mac os x tips and tricks

Monday, February 27, 2017

Kinda rough regex for pattern matching and capturing apache log info

the IP is parsed into \2 \3 and \4
^(((25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)\.){3}(25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)) \- \- (\[.*?\]) "(.*?)" (\d+) (\d+) "(.*?)" "(.*?)"$

No comments:

Post a Comment