title: VB.NET: Regular Expression needed to replace return character with another string
body: <p>I'm trying to replace all the carriage return characters in a string obtained from a multi line text box in a Windows Form with the string <code>", &lt;BR&gt;"</code> so that when I use the string in some HTML it displays correctly.</p>
  
  <pre><code>Function Blah(ByVal strInput As String) As String
    Dim rexCR As Object
    rexCR = CreateObject("VBScript.RegExp")
    rexCR.Pattern = "\r"
    rexCR.Global = True
    Blah = rexCR.Replace(strInput, ",&lt;BR&gt;")
  End Function
  </code></pre>
  
  <p>Tried searching for any of the following characters and still no luck: <br>
  <code>\r|\n|\r\c|\cM|\x0d</code></p>
  
  <p>Problem seems to be the function/expression is not detecting any carriage returns in the text and I have no idea why?
  I know the function works as I can put a different expression in there as a test and it's OK </p>
  
  <p>Any ideas?</p>