Regular Expressions 101

Community Patterns

Community Library Entry

0

Regular Expression
PCRE (PHP <7.3)

/
^(?<time>[^ ]* {1,2}[^ ]* [^ ]*) (?<ident>[a-zA-Z0-9_\/\.\-]*)(?:\[(?<pid>[0-9]+)\])?(?:[^\:]*\:)? \[(?<time_server>[^\]]*)\] (?<host>[^ ]*) - (?<user>[^ ]*)\\"(?<method>\S+)(?: +(?<path>[^\"]*) +\S*)?" (?<code>[^ ]*) (?<size>[^ ]*) \\"(?<referer>[^\"]*)\\" \\"(?<agent>[^\"]*)\\"rt=(?<request_time>[^ ]*) uct=\\"(?<upstream_connect_time>[^ ]*)\\" uht=\\"(?<upstream_header_time>[^ ]*)\\" urt=\\"(?<upstream_response_time>[^ ]*)\\" uaddr=\\"(?<upstream_addr>[^ ]*)\\" x-forwarded-for=\\"*(?<http_x_forwarded_for>.*)\\"$
/
g

Description

no description available

Submitted by anonymous - 6 years ago