How do you get a string that has line feeds (vbNewLine, vblf, vbcrlf, etc) and line continuations. The following only seems to be retrieving the “First line of text.”.
Dim rx As Regex
Dim var1 As String = "First line of text. " & vbNewLine & _
"Second line of text. " & vbNewLine & _
"Third line of text."
rx = New Regex(".*[\n\r]")
Dim search As String = rx.Match(var1).Value
Expected result: search = “First line of text. Second line of text. Third line of text.”
For matching multiline patterns with a regex you must use the singleline option. It modifies the dot behavior so that it captures every character, newlines included.
Link to msdn here.