I am getting like this error in my application:
The application uses a dangerous regex pattern "/(?:\[rn]|[\r\n]+)+/g", at line 02 line number javascript code.
So How to resolve this vulnerable issue in regular expression? Any alternate method is there?
var longline = "dddgjjb gah hjjjj \ fghjj hjjjjj"+"Dffjjhk"; var test=longline.replace(/(?:\\[rn]|[\r\n]+)+/g, "<br />").replace(/(?:\\+)+/g,""); // 02 line number console.log(test);
var test=longline.replace(/(?:\\[rn]|[\r\n]+)+/g,'');- The problem is due to putting regex inside double quotes.