javascript - Regex to remove some special character occurring multiple times in string -


i have string following in javascript:

"[ \"\\"[[\\"leadownerkey\\",\\"suyog\\",\\"praneet\\"], [\\"open\\",\\"1\\",\\"1\\"], [\\"total count\\",\\"1\\",\\"1\\"]]\\"\" ]" 

i have remove occurrences of \ , " have keep occurrences of [ , ] , ,.

can suggest regex it? or there other way achieve it?

str = str.replace(/[\\"]/g, ''); 

outputs:

[ [[leadownerkey,suyog,praneet], [open,1,1], [total count,1,1]] ] 

http://jsfiddle.net/0mtl3oyu/


Comments

Popular posts from this blog

asp.net mvc - SSO between MVCForum and Umbraco7 -

Python Tkinter keyboard using bind -

ubuntu - Selenium Node Not Connecting to Hub, Not Opening Port -