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

No example input so no idea if you are even getting a match.

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.