I have this string: "\W\W\R\"
I want to use regex to produce this string: <span>W</span><span>W</span>\R
Here is my code:
"\W\W\R".replace(/\\W/g, "<span>W</span>");
Because the pattern "\W" is a character class, none of the escaping I'm trying to do is responding. How should this be written?