Regex to extract time information from a string : <p>I'm receiving data from a third party device. I need to extract two pieces of information. I think I need to use a Regular Expression, but I don't know anything of this.</p>

<p>Below you can find a few example strings:</p>

<pre><code>TN        12  1 17:45:19.90400  7173
TN         4  4 17:45:20.51800  7173
TN        13  1 17:45:24.03200  7173
TN         5  4 17:45:26.06300  7173
TN         6  4 17:45:29.28700  7173
TN        14  1 17:45:31.03200  7173
</code></pre>

<p>From each of these strings I need to extract two pieces of data:</p>

<ul>
<li>the time</li>
<li>the number before the time</li>
</ul>

<p>So the data I'm looking for is this:</p>

<pre><code>1 and 17:45:19.90400
4 and 17:45:20.51800
1 and 17:45:24.03200
4 and 17:45:26.06300
4 and 17:45:29.28700
1 and 17:45:31.03200
</code></pre>

<p>The number will always be present and it will always be 1, 2, 3 or 4.
The time will also be the same format but I'm not sure if there will be single digit hours. So I don't know if 9 o'clock will be displayed as </p>

<blockquote>
  <p>9 or 09</p>
</blockquote>

<p>Any suggestions on how I can extract this using a RegEx?</p>

<p>Thanks</p>
