• + 0 comments

    There is a tab/whitespace (\s) at the beginning of the line having HEX :

    import re
    for _ in range(int(input())):
        s = input()
        if re.search(r'^\s.*(#[\da-fA-F]{3,6})', s):
            print(*re.findall(r'#[\da-fA-F]{3,6}', s), sep='\n')