import re
rx = r"^[^:-][^:]*"
text = "enx002: connected to Wired connection 2\ndocker0: connected to docker0\nvirbr0: connected to virbr0\ntun0: connected to tun0"
print( re.findall(rx, text, re.M) )
print( re.findall(r'^([^:\n-][^:\n]*):', text, re.M) )
