i am new to C# i want to replace Figure 1, Figure 2....... with <a href="#fig1">Figure 1</a>....... i used the following code but no desired output

{
string targetId = "1";
            string pattern = @"(?<=<a[^>]+href=""Figure\?mId=(?<Id>" + targetId + @")(?="">)";
            string replace = "<a href>Figure</a>?pId=${Id}";
            string result = Regex.Replace(input, pattern, replace);
            }

please help me