正则python正则,提取\t\n里面的大写英文字母

时间:2023-01-27 05:21:15
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