ss = '['\r\n\t\t\t\t\t\t\t\t\t', '\r\n\t\t\t\t\t\t\t', '\r\n\t\t\t\t\t\t\t\t\tCMA CGM JACQUES JOSEPH 7\r\n\t\t\t\t\t\t\t', '\r\n\t\t\t\t\t\t\t\t', '\r\n\t\t\t\t\t\t\t', '\r\n\t\t\t\t\t\t\t\t-\r\n\t\t\t\t\t\t']' result = ''.join(re.findall(r'([A-Z].*[0-9]|[A-Z].*[A-Z])', vessel)) >>>>CMA CGM JACQUES JOSEPH 7