How to replace part of text with html text : I want to replace matching keyword in text with same keyword but wrapped with `<span></span>`

    example : This is the sample text to be searched

replaced text should be line

    This is the <span class="match">sample</span>text to be searched

i am using following code but its not working

    protected String getTitle(object title)
    {
        string sTitle = title.ToString();
            Regex regex = null;
            string pattern = @"(\b(?:" + _Keyword.ToString().Trim() + @")\b)(?![^<]*?>)";
            regex = new Regex(pattern);
            sTitle = regex.Replace(sTitle, "<span class='keyword-highlight'>" + _Keyword + "</span>");
            return sTitle;
    }


above code replace whole text with keyword not just the matching part