Regular Expressions 101

Community Patterns

Community Library Entry

1

Regular Expression
ECMAScript (JavaScript)

/
(\d{2})\/(\S+)\/(\d{4}):(\d{2}):(\d{2}):(\d{2})\s[+\-](\d{4})
/

Description

Parses the common log format into component elements. According to wikipedia, common log is strftime format %d/%b/%Y:%H:%M:%S %z

Submitted by Matt Ingenthron <ingenthr@cep.net> - 10 years ago