I have a list of dates and times in the following format: 25/07/201711:00:00 I just want to insert whitespace between the date and time so it looks like: 25/07/2017 11:00:00
The string replace method works well but is not very robust i.e. mystring.replace("2017","2017 " ) works but only for 2017 dates. Regex sub method seems to be what I need to use but have not been successful so far. Any suggestions would be very helpful as my regex knowledge is limited.
This is closest from what I have tried:
>>>re.sub(r'20[0-9][0-9]', r'20[0-9][0-9] ', s)
'20[0-9][0-9] 04:00'