title: Match "THIS" And Replace with "THAT" RegEx Vb.Net
body: <p>Trying to find out how to find and replace text with corresponding values.</p>
  
  <p>For Example</p>
  
  <p>1) fedex to FedEx
  2) nasa to NASA
  3) po box to PO BOX</p>
  
  <pre><code>Public Function FindReplace(ByVal s As String) As String
  
      Dim MatchEval As New MatchEvaluator(AddressOf RegexReplace)
  
      Dim Pattern As String = "(?&lt;f1&gt;fedex|nasa|po box)"
  
      Return Regex.Replace(s, Pattern, MatchEval, RegexOptions.IgnoreCase)
  
  End Function
  
  Public Function RegexReplace(ByVal m As Match) As String
      Select Case LCase(m.Groups("f1").Value)
          Case "fedex"
              Return "FedEx"
          Case "nasa"
              Return "NASA"
          Case "po box"
              Return "PO BOX"
      End Select
  End Function
  </code></pre>
  
  <p>The above code is working fine for fixed values but don't know how to use the above code to match added values on run-time like db to Db.</p>