I have asked this question before and now i edit it because i found some lines that doesn't correspond to the format i gave before ...
here's an example of the lines:
data = "09:55:04.125 mta Messages I Doc O:SERVER (NVS:SMTP/me@domain.com) R:NVS:FAXG3.I0.0101 mid:6393"
data2= "09:55:05.045 mta Messages I Doc O:SERVER (NVS:SMTP/me@domain.com) R:ADMIN (NVS:SMTP.0/me@domain.fr) mid:6397"
at first i have matched what's between the slash and two points but i've noticed that there's some lines like the first where the type "FAXG3.I0.0101" isn't followed by a slash
here's the regex i use:
exp = result = re.findall(r'[\w\.]+(?=:*)',data) # type S & D
the result i want is 'SMTP','FAXG3.I0.0101' for the first line and 'SMTP','SMTP.0' for the second. can someone help correcting my regex to get that ??