debug url function, repalce regexp