Python does not support conditionals using lookaround, even though Python does support lookaround outside conditionals. (?(?=regex) then|else) is illegal in python (?=regex)then|(?!regex)else - this works. madness
(?(?=regex) then|else)
(?=regex)then|(?!regex)else
details in the test strings