convert d2delight.sh to d2delight.py because sed does not support lookahead