(?x)applies the following effective flags to the remainder of the pattern: gmx x modifier: extended. Ignores unescaped whitespace and comments outside character classes
^start of line
Group remote_host(?P<remote_host>\S+) \S+any character that is not Unicode whitespace, repeated at least once
\s+a Unicode whitespace character, repeated at least once
Comment: host %h
\S+any character that is not Unicode whitespace, repeated at least once
\s+a Unicode whitespace character, repeated at least once
Comment: indent %l (unused)
Group remote_user(?P<remote_user>\S+) \S+any character that is not Unicode whitespace, repeated at least once
\s+a Unicode whitespace character, repeated at least once
Comment: user %u
\[the literal [ (9110 / 1338 / 5B16)
Group time_received(?P<time_received>.*?) .*?any Unicode character (except for line terminators), repeated any number of times
\]the literal ] (9310 / 1358 / 5D16)
\s+a Unicode whitespace character, repeated at least once
Comment: time %t
"the literal text "
Group request(?P<request>.*?) .*?any Unicode character (except for line terminators), repeated any number of times
\s+a Unicode whitespace character, repeated at least once
Comment: request "%r"
Group status(?P<status>[0-9]+) +matches at least one character from the set below:
0-9one character from 0 (4810) to 9 (5710)
\s+a Unicode whitespace character, repeated at least once
Comment: status %>s
Group response_bytes_clf(?P<response_bytes_clf>\S+) \S+any character that is not Unicode whitespace, repeated at least once
Non-Capturing Group(?:\s+ # size %b (careful, can be '-')
"(?P<referrer>[^"?\s]*[^"]*)" \s+ # referrer "%{Referer}i"
"(?P<user_agent>.*? )" (?:\s+ # user agent "%{User-agent}i"
"[^"]*" )?)? ?repeats the group contents below at most once:
\s+a Unicode whitespace character, repeated at least once
Comment: size %b (careful, can be '-')
"the literal text "
Group referrer(?P<referrer>[^"?\s]*[^"]*) Negated Character Class[^"?\s]* *matches any number of characters outside the set below:
"the literal " (3410 / 428 / 2216)
?the literal ? (6310 / 778 / 3F16)
\sa Unicode whitespace character
Negated Character Class[^"]* *matches any number of characters outside the set below:
"the literal " (3410 / 428 / 2216)
\s+a Unicode whitespace character, repeated at least once
Comment: referrer "%{Referer}i"
"the literal text "
Group user_agent(?P<user_agent>.*? ) .*?any Unicode character (except for line terminators), repeated any number of times
Non-Capturing Group(?:\s+ # user agent "%{User-agent}i"
"[^"]*" )? ?repeats the group contents below at most once:
\s+a Unicode whitespace character, repeated at least once
Comment: user agent "%{User-agent}i"
"the literal text "
Negated Character Class[^"]* *matches any number of characters outside the set below:
"the literal " (3410 / 428 / 2216)
Comment: optional argument (unused)
$end of line
g modifier: global. Finds all matches instead of stopping after the first
m modifier: multiline. Causes ^ and $ to match the start and end of each line, not only the start and end of the string