I\'m trying to use JavaScript & regex to replace numerical HTML entities with their actual Unicode characters, e.g.
foo's bar → foo\'s bar
"foo's bar".replace(/([^\s]*);/g, function(x, y) { return String.fromCharCode(y) })
First argument (x) is a "'" in current example. y is 39.