Using Regex.Replace() to replace text in a string
<p>I want to use Regex.Replace() to loop through a string containing words that are separated by '//' to check if any of the words match a string value which has been passed to the method. If the text string does match one of the words in the wordList, replace it and return 'matched', if it doesn't match any of the words then return the original word that was passed to the method and don't replace it.</p>

<p>Here's my code at the moment:</p>

<pre><code>    public void CheckText(string text)
    {
        //Check text entered by user

        string wordList = "word1//word2//word3 etc...";
        string replaceString = "matched";

        if (!string.IsNullOrEmpty(wordList))
        {
            //How do I implement this part?
            return Regex.Replace(text, wordList, replaceString); 
        }
    }
</code></pre>

<p>Please could someone help me with this? Any help/comments will be appreciated!</p>

<p><strong>Update:</strong> (pasted from update to question posted as an answer by OP)</p>

<p>Thanks for your replies. I probably didn't explain the question correctly. I want the method to replace the text string it is passed if it matches a string in the wordList. For example, 'word1' is passed to the method, the method then checks to see if 'word1' is in the wordList and if it is, replace the original string that was passed to the method with 'matched', and then return 'matched', if it didn't match any of the words in the wordList, then return the orignial string and don't replace it.</p>
