I want to remove << any words #_ from the following string.
stringVal = "<<Start words#_ I <<love#_ kind <<man>>, <<john#_ <<kind man>> is really <<great>> <<end words#_ ";
Result mast be:
Start words I love kind <<man>>, john <<kind man>> is really <<great>> end words
I tried like this:
stringVal = stringVal.replace(/^.*<<.+\#_.*$/g, "");
But it removes all string.
Note: << any words #_ may exists multiple time in string, at the start, in the middle or at the end
<<john#_instead of<<john#?<<(\w+)#which needs to be replaced by$1, see a demo on regex101.com.