How To Use Regex In If Condition Python