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 - Exception while importing pymorphy2 -

c# - Nested Internal Class with Readonly Hashtable throws Null ref exception.. on assignment -