Extract all caps word contained in ANSI colored text
How might I extract this all caps word contained in regex with ANSI code for colored text in the terminal? Example: s1 = ‘ Elapsed: 0:00:59.694 – Elapsed/GB: 0:00:00.125 – Result: \x1b[92mPASS\x1b[0m\r\n’ My Failures: re.findall(r’- Result: [^\x1b[92m\x1b[0m\r\n]’, s1) re.findall(r’- Result: ([A-Z]+)’, s1) Expected: PASS >Solution : Try this: re.findall("\x1b\\[.*?m([A-Z0-9]+?)\x1b\\[", a) So, first, if it will… Read More Extract all caps word contained in ANSI colored text