regex = re.compile('\\((\\w+)\\s+(and|or)\\s+(\\w)\\)|(\\w+)')
results = regex.findall(expr)
results = [(i[:3] if i[0] else i[3]) for i in results]
results
Parse boolean arithmetic including parentheses with regex?