its cause the regsubex match is like this
/&#(\d+)/
Jethro already know, but my advice is use
/&#(\d+);/