Regular Expressions 101

Community Patterns

Community Library Entry

1

Regular Expression
Python

r"
^([^ ]*) - ([^ ]*) \[(.*)\] \"([^ ]*) ([^ ]*) ([^ ]*)\" (-|[0-9]*) (-|[0-9]*) \"(.+?|-)\" ([^ ]*|-) ([^ ]*|-) ([^ ]*|-) \"(.+?|-)\" \"(.+?|-)\" \"(.+?|-)\"$
"

Description

separate nginx log into database table-style fields

Submitted by wgzhao - 10 years ago