import re
text = """2023-05-27 / 23:06:31 Computer account added/changed/deleted. medium ANONYMOUS LOGON PC-CR5$ SRVDC2 ACME 1
2023-05-27 / 23:28:08 Computer account added/changed/deleted. medium ANONYMOUS LOGON SRVXAP02$ SRVDC2 ACME 1
2023-05-28 / 02:24:29 User account locked out multiple login errors high SRVDC2$ john.smith.admin SRVDC2 \\\\NECBROWSER 1
2023-05-28 / 05:01:48 Computer account added/changed/deleted. medium ANONYMOUS LOGON SRVNPS01$ SRVDC1 ACME 1
2023-05-28 / 06:38:57 Computer account added/changed/deleted. medium ANONYMOUS LOGON VD-OPERATOR1$ SRVDC1 ACME 1"""
pattern = re.compile(r'''
\d{2}:\d{2}:\d{2}\s+
(.*?)
\s(?:medium|high|low|critical)
''', re.VERBOSE)
messages = [match.group(1) for match in pattern.finditer(text)]
print(messages)
aW1wb3J0IHJlCiAgICAKdGV4dCA9ICIiIjIwMjMtMDUtMjcgLyAyMzowNjozMSBDb21wdXRlciBhY2NvdW50IGFkZGVkL2NoYW5nZWQvZGVsZXRlZC4gbWVkaXVtIEFOT05ZTU9VUyBMT0dPTiBQQy1DUjUkIFNSVkRDMiBBQ01FIDEKMjAyMy0wNS0yNyAvIDIzOjI4OjA4IENvbXB1dGVyIGFjY291bnQgYWRkZWQvY2hhbmdlZC9kZWxldGVkLiBtZWRpdW0gQU5PTllNT1VTIExPR09OIFNSVlhBUDAyJCBTUlZEQzIgQUNNRSAxCjIwMjMtMDUtMjggLyAwMjoyNDoyOSBVc2VyIGFjY291bnQgbG9ja2VkIG91dCBtdWx0aXBsZSBsb2dpbiBlcnJvcnMgaGlnaCBTUlZEQzIkIGpvaG4uc21pdGguYWRtaW4gU1JWREMyIFxcXFxORUNCUk9XU0VSIDEKMjAyMy0wNS0yOCAvIDA1OjAxOjQ4IENvbXB1dGVyIGFjY291bnQgYWRkZWQvY2hhbmdlZC9kZWxldGVkLiBtZWRpdW0gQU5PTllNT1VTIExPR09OIFNSVk5QUzAxJCBTUlZEQzEgQUN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