Reputation: 21
I have a list of timestamps containing only one timestamp on each line like 00:06:29:14
which follows as: hours, minutes, seconds, and milliseconds. Now, I want to delete hours and milliseconds to get only the minutes and seconds like 06:29
from this certain list.
On Notepad++ I find ^[^:]+:(.+)$
replacing all with $1
in Regular expression Search Mode, which gives me the result of only removing the hours part at the beginning.
I need a single code to both delete hours at the beginning and milliseconds at the end of each line to save a great chunk of my time to work smart. Any ideas?
Upvotes: 0
Views: 588
Reputation: 163277
You can make the match a bit more specific and replace with group 1
^\d{2}:(\d{2}:\d{2}):\d+$
Or matching the hours, minutes and seconds:
^(?:[01]?\d|2[0-3]):([0-5]?\d:[0-5]?\d):\d+$
Upvotes: 1