Dan
Dan

Reputation: 527

Regex removing seconds in timestamp

Using BBEdit, this pattern :[0-9][0-9]\s removes the : and seconds in lines such as these but I cannot work out how to both remove the :00 (for example) AND replace the line feed in the same go. Unix and UTF8 encoded document. I am a serious noob in regex...

2014-01-01  06:30:03  07:04:55  07:41:07  08:13:51  17:13:01  17:45:45  18:21:57  18:56:49  08:59:10
2014-01-02  06:30:12  07:05:03  07:41:13  08:13:54  17:13:54  17:46:35  18:22:45  18:57:37  08:59:59
2014-01-03  06:30:19  07:05:09  07:41:17  08:13:55  17:14:49  17:47:28  18:23:36  18:58:25  09:00:53

Upvotes: 0

Views: 404

Answers (1)

caligari
caligari

Reputation: 2128

Try this one: (:[0-9][0-9]\s|:[0-9][0-9]$)

Upvotes: 1

Related Questions