Regex for nginx log parser I made the following regular expression for parsing ngnix log

log_1 = "1.169.137.128 -  - [29/jun/2017:07:10:50 +0300] "GET /api/v2/banner/1717161 http/1.1" 200 2116 "-" "Slotovod" "-" "1498709450-2118016444-4709-10027411" "712e90144abee9" 0.199"


My test cases (https://regex101.com/r/Eyhxod/1)

lineformat = re.compile(r"""(?P&lt;ipaddress&gt;\d{1,3}\.\d{1,3}\.\d{1,3}\.\d{1,3}) -  - \[(?P&lt;dateandtime&gt;\d{2}\/[a-z]{3}\/\d{4}:\d{2}:\d{2}:\d{2} (\+|\-)\d{4})\] \"GET (?P&lt;url&gt;.+?(?=\ http\/1.1")) http\/1.1" \d{3} \d+ "-" (?P&lt;http_user_agent&gt;.+?(?=\ )) "-" "(?P&lt;x_forwaded_for&gt;(.+?))" "(?P&lt;http_xb_user&gt;(.+?))" (?P&lt;request_time&gt;[+-]?([0-9]*[.])?[0-9]+)""",re.IGNORECASE)


Output:

data = re.search(lineformat, log_1)
data.groupdict()

{'ipaddress': '1.169.137.128',
 'dateandtime': '29/jun/2017:07:10:50 +0300',
 'url': '/api/v2/banner/1717161',
 'http_user_agent': '"Slotovod"',
 'x_forwaded_for': '1498709450-2118016444-4709-10027411',
 'http_xb_user': '712e90144abee9',
 'request_time': '0.199'}


I believe I should make it more robust towards edge cases and broken logs. Also I consider splitting my long expression into a smaller one. 
Any advices towards the best-practices are appreciated.
At the very least, use verbose mode so you can see the whole thing at once.  Remember to explicitly include whitespace.

lineformat = re.compile(r"""
   (?P&lt;ipaddress&gt;\d{1,3}\.\d{1,3}\.\d{1,3}\.\d{1,3})\s+
   -\s+
   -\s+
   \[(?P&lt;dateandtime&gt;\d{2}\/[a-z]{3}\/\d{4}:\d{2}:\d{2}:\d{2} (\+|\-)\d{4})\]\s+
   \"GET (?P&lt;url&gt;.+?(?=\ http\/1.1")) http\/1.1"\s+
   \d{3}\s+
   \d+\s+
   "-"\s+
   (?P&lt;http_user_agent&gt;.+?(?=\ ))\s+
   "-"\s+
   "(?P&lt;x_forwaded_for&gt;(.+?))"\s+
   "(?P&lt;http_xb_user&gt;(.+?))"\s+
   (?P&lt;request_time&gt;[+-]?([0-9]*[.])?[0-9]+)
   """,
   re.IGNORECASE | re.VERBOSE)