Using regex, I need to get the expected ouput:
string="Tue Apr 24 22:35:48 2018 53/e33
hello:55|Wordcap|abc|abc generate|6|Wordcapdata_proto_req=WINTER Wordcapdata_sample_resp=summer 2.4.5 WordcapTotal_reject=56 WordcapAddition_sum=TEA CUP ONE"
Expected output = ['data_proto_req=WINTER', 'data_sample_resp=summer 2.4.5', 'Total_reject=56', 'Addition_sum=TEA CUP ONE']
The problem is dealing with the spaces in these strings : summer 2.4.5
or TEA CUP ONE
This is my intial attempt at getting the regex:
print re.findall(r'[W]*ordcap([^|].*?=.*?)[\s|\t]*(?:W|$)', string)
The output I'm getting is :
['data_proto_req=', 'data_sample_resp=summer 2.4.5', 'Total_reject=56', 'Addition_sum=TEA CUP ONE']