Compile Method In Regex Python