Regular Expressions 101

Community Patterns

Community Library Entry

1

Regular Expression
Python

r"
(?P<host>[^\s]+) (?P<ip>\d+\.\d+.\d+\.\d+)?(?:\s+\[?)(?P<date>.*?)\s+(?P<timezone>.*?)(?:\]?) (?:[^\s]+?) (?:[^\s]+?) \"(?P<method>\S+)\s+(?P<path>.*?)\s+\S+\s+(?P<status>\S+)\s+(?P<length>\S+)(?:\s+\"?)(?P<referrer>.*?)(?:\"?)(?:\s+\"?)(?P<user_agent>[^\"]+)\"
"
gm

Description

no description available

Submitted by Lennart Peeters - 8 years ago