Can someone explain this to me. I am pretty good with perl regular expressions but evidently I am at a loss on why this doesn't work.
The code below stores "Person Test" in output variable.
im output As String
Dim userName As String = "Test, Person"
Dim re As New Regex("(\w+),\s(\w+)", RegexOptions.Singleline)
output = re.Replace(userName, "$2 $1")
So why doesn't the following code store "#Test##Person#" in output variable.
Dim output As String
Dim userName As String = "Test, Person"
Dim re As New Regex("(\w+),\s(\w+)")
For Each Match As Match In re.Matches(userName)
output &= "#" & Match.ToString & "#"
Next
Thanks for the help.