See comments below
Agh, and replace /(d+)/g with /([backslash]d+)/g :X
Just replace $asc(1) and $chr(1) with $chr(backslash1) and $asc(backslash1)
I think using $regsubex would be better in this case. Here is an updated version of the code:
Same syntax and all, just uses $regsubex.
Very nice job on this.
comments, rants, criticism?