Capturing timestamp from Apache Web log file

Q

How to capture the timestamp from Apache Web log file?

Here are some Apache Web log file entries:

✍: Guest

A

Apache Web log file entries are written in this format:

host - user time method path protocol status size referer agent cookie

The regular expression to capture timestamp from Apache Web log file entries can be written as: with the multiple lines modifier "m" specified:

Click the button to test this regular expression here online:

2013-02-03, 0👍, 0💬