I have a large text file which contains many timestamps. The timestamps look like this: 2013/11/14 06:52:38AM
. I need to remove the last two characters (am/pm/AM/PM) from each of these. The problem is that a simple find and replace of "AM" may remove text from other parts of the file (which contains a lot of other text).
I have done a find using the regular expression (:\d\d[ap]m)
, which in the above example would track down the last bit of the timestamp: :38AM
. I now need to replace this with :38
, but I don't know how this is done (allowing for any combination of two digits after the colon).
Any help would be much appreciated.
EDIT: What I needed was to replace (:\d\d)[ap]m
with \1