title: Check a pattern in a string then convert it to upper case
body: <p>I was not clear with my previous <a href="https://stackoverflow.com/questions/21658079/split-string-with-space-and-forward-slash-by-forward-slash/21658088#21658088">question</a></p>
  
  <p>I have a list: <code>new List&lt;string&gt; { "lts", "mts", "cwts", "rotc" };</code></p>
  
  <p>Now I wan't to check a pattern in string that starts or ends with a forward slash like this: <strong>"cTws/Rotc/lTs"</strong> or <strong>"SomethingcTws cWtS/Rotc rOtc"</strong>. </p>
  
  <p>and convert to upper case only the string that starts/ends with a forward slash based on the list that I have.</p>
  
  <p>So the output should be: <strong>"CWTS/ROTC/LTS"</strong>, <strong>"SomethingcTws CWTS/ROTC rOtc"</strong></p>
  
  <p>I modified <a href="https://stackoverflow.com/a/21658650/2930551">Sachin</a>'s answer:</p>
  
  <pre><code>        List&lt;string&gt; replacementValues = new List&lt;string&gt;
          {
              "cwts",
              "mts",
              "rotc",
              "lts"
          };
          string pattern = string.Format(@"\G({0})/?", string.Join("|", replacementValues.Select(x =&gt; Regex.Escape(x))));
          Regex regExp = new Regex(pattern, RegexOptions.IgnoreCase);
          string value = "Cwts/Rotc Somethingcwts1 Cwts/Rotc/lTs";
          string result = regExp.Replace(value, s =&gt; s.Value.ToUpper());
  </code></pre>
  
  <p>Result: <strong>CWTS/ROTC Somethingcwts1 Cwts/Rotc/lTs</strong></p>
  
  <p>The desired output should be: <strong>CWTS/ROTC Somethingcwts1 CWTS/ROTC/LTS</strong></p>