I have a text message and I want to parse the special characters in it. I have the list of special characters. I wrote the following regex but this shows compile time error. Looks like there is something with escape characters, but i'm not able to figure out.
This is the character list, i want to replace, without the quotes "<3","<\/3",";p","C:","c:",":D",":-D",":/",":-/",":o",":-o",":p",":-p",":P",":-P",":b",":-b",";-p",";b",";-b",";P",";-P","D:",":->",":>",":)",":-)","(:",";)",";-)",":sj:","):",":(",":-(",":'(","=)","=-)",">:(",">:-(","8)",":\\\\",":-\\\\",":*",":-*",":|",":-|"
return msg.replace(/(<3|<\/3|;p|C:|c:|:D|:-D|:/|:-/|:o|:-o|:p|:-p|:P|:-P|:b|:-b|;-p|;b|;-b|;P|;-P|D:|:->|:>|:)|:-)|(:|;)|;-)|:sj:|):|:(|:-(|:'(|=)|=-)|>:(|>:-(|8)|:\\\\|:-\\\\|:*|:-*|:||:-|)/g, function myFunction(x){
console.log(x);
return x;
}