I have string it contain unwanted html tags and text, so I want to remove unwanted matching text and get my required values:
Code:
var mystring = "<!-- html-text: 143 --> value 1 <!-- /html-text --><!-- html-text: 144 --> | <!-- /html-text --><!-- react-text: 145 --> value 3 <!-- /html-text --><!-- html-text: 146 -->, <!-- /html-text --><!-- html-text: 147 --> value 2 <!-- /html-text --><!-- html-text: 148 --> <!-- /html-text --><!-- html-text: 149 -->value 4 <!-- /html-text -->";
mystring = mystring.replace('<!-- html-text: 143 -->','');
console.log('str'+mystring);
Required output:
value 1 value 2 value 3 value 4