I\'ve got a JS string
var str = \'@robot ping\';
I need to remove this part of a string
Use // for regex. Replace "<at.+@" with /<at.+@/.
//
regex
"<at.+@"
/<at.+@/
var str = '<at id="11:12345678">@robot</at> ping'; str = str.replace(/<at.+@/,""); console.log(str);
Documentation for replace