I have text file which contains the information in below format.
2018/03/21-17:08:48.638553 508 7FF4A8F3D704 snononsonfvnosnovoosr
2018/03/21-17:08:48.985053 346K 7FE9D2D51706 ahelooa afoaona woom
2018/03/21-17:08:50.486601 1.5M 7FE9D3D41706 qojfcmqcacaeia
2018/03/21-17:08:50.980519 16K 7FE9BD1AF707 user: number is 93823004
2018/03/21-17:08:50.981908 1389 7FE9BDC2B707 user 7fb31ecfa700
2018/03/21-17:08:51.066967 0 7FE9BDC91700 Exit Status = 0x0
2018/03/21-17:08:51.066968 1 7FE9BDC91700 std:ZMD:
Expected Result
I want to remove part of the string till 3rd space (that is 7FF4A8F3D704). Result should look like
snononsonfvnosnovoosr
ahelooa afoaona woom
qojfcmqcacaeia
user: number is 93823004
user 7fb31ecfa700
Exit Status = 0x0
std:ZMD:
Solution
I can remove "2018/03/21-17:08:48.638553" with the below code. But I am trying to replace the whole part with ''.
import re
Regex_list = [r'\d{4}/\d{2}/\d{2}-\d{2}:\d{2}:\d{2}.\d{6}']
for p in Regex_list:
text = re.sub(p, ' ', file)