 <p>Worked it out. I needed the following pattern:</p> <pre><code>(?&lt;date&gt;(?&lt;day&gt;\d{1,2})-(?&lt;month&gt;\d{1,2})-(?&lt;year&gt;(?:\d{4}|\d{2}))\s(?&lt;time&gt;(?&lt;hour&gt;\d{2}):(?&lt;minutes&gt;\d{2}):(?&lt;seconds&gt;\d{2})(?&lt;milli&gt;\.?\d{0,3})))\s(?&lt;logEntry&gt;.*) </code></pre>