I'm getting passed a string from an API method I have no control over that returns strings with paths that sometimes that look like: /toplevel/nextlevel/_x0034_33name/myoutput.log
It seems to happens with directory names that start with a number. In this case the directory name should be '433name'.
I'm guessing that x0034 represents hex for the character '4', possibly in unicode.
The following Javascript returns '4', which would be correct:
String.fromCharCode(parseInt("0034",16))
Is there a regex command or conversion utility in Javascript readily available to remove and replace all these characters in the string with their correct equivalents?