I would like to replace or delete substring inside a sentence using Js or reactJS.
The below is my sample sentence.
RAND Corporation is an American nonprofit global policy think tank created in 1948 by Douglas Aircraft Company to offer research and analysis to the United States Armed Forces.
It is financed by the U.S. government and private endowment, corporations, universities and private individuals
Source: <Origin Href="Link">https://rand.org</a>
Thanks .....
In this sentence, I need to find Source: <Origin Href="Link">https://rand.org</a>
So basically it will be something like Source * </a>
Source
& </a>
will be the common string in other sentences too. *
is the wildcard, may contain various other texts.
So, how to remove this line or replace with space or something.
My current code is
var sb = "RAND Corporation is an American nonprofit global policy think tank created in 1948 by Douglas Aircraft Company to offer research and analysis to the United States Armed Forces. It is financed by the U.S. government and private endowment, corporations, universities and private individuals Source: <Origin Href=\"Link\">https:\/\/rand.org</a> Thanks ..... "
var result = sb.replace(/\nSource:.*<\/a>/, '')
alert(result)