VB2012:使用正则表达式替换某些短语。有没有办法报告实际有多少替换。
Dim regex As Regex = New Regex("^PENALTY", RegexOptions.IgnoreCase Or RegexOptions.Multiline)
Dim replacement As String = "PENALTY PER MINUTE"
Dim result As String = regex.Replace(input, replacement)
Dim p as Integer = 0 'how do I get this???
MsgBox(p.ToString & " replacements were made")