How to replace and matches a specific String with input string : <p>My database table column contains several Strings like below mentioned:</p>

<pre><code>---------------------------
id    |        string     |
---------------------------
1     | I love C# Code    |
---------------------------
2     | I love Java Code  |
---------------------------
3     | I love python Code|
---------------------------
4     | hello java        |
---------------------------
5     | hello c#          |
---------------------------
</code></pre>

<p>In c# each row at a time will be fetched from data base and I want to check my given pattern is matches or not.</p>

<p>My pattern is: <code>I love &lt;anything&gt; Code</code></p>

<p>And I also want to replace  by another String.</p>

<p>I have tried: </p>

<pre><code>foreach( string record in stringsFromDB){

    boolean isMatches=Regex.Matches(record, "I love .+? Code");

    if(isMatches){
        Console.Writeline("String matches");
    }else{
        Console.Writeline("String not matches");
    }

    string newString= Regex.Replace(record, "I love .+? Code","",, RegexOptions.IgnoreCase);

    Console.Writeline(newString);

}
</code></pre>

<p>Expected Result:</p>

<p>For matching:
For first three records it will print: String matches. For the else two print: String not matches.</p>

<p>And</p>

<p>For replacing:
For first three records it will print: I love Code. For the else two print as it is. </p>

<p>But nothing happen when i write code.</p>

<p>Please help.</p>

<p>Thanks.</p>
