How can I convert \74 and \76 to its string representation?
I h开发者_开发知识库ave this string
Kindle-Wirel\\74wbr\\76ess-Reading-Display-Globally/dp/B003FSUD\\74wbr\\76M4/ref\\75amb_link_353259562_2?pf_rd_m\\75ATVP\\74wbr\\76DKIKX0DER\\46pf_rd_s\\75center-10\\46pf_rd_r\\07511EY\\74wbr\\76KTN682A79T370AM3\\46pf_rd_t\\075201\\46pf_rd_p\\075127\\74wbr\\0760985982\\46pf_rd_i\\75B002Y27P3M#jjdkasdjskjsk\\74wbr\\76jj$jkdsajdks
I need to convert \\74
to <
, \\76
to >
and so on...
How can I do it?
It seems the numbers are octal, and they have only 2 characters, so...
var newtext = text.replace(/\\\\([0-7]{2})/gm,function(all,n){
return String.fromCharCode(parseInt(n,8));
});
精彩评论