16,721
社区成员




Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
Dim matchesRegex As New Regex("ef$", RegexOptions.Multiline) '正则表达式
Dim matchesFound As MatchCollection
matchesFound = matchesRegex.Matches("ab123ef" + Chr(13) & Chr(10) + "ab234ef") '搜索所有匹配
For Each match As Match In matchesFound
MsgBox(match.Value)
Next match
End Sub
Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
Dim matchesRegex As New Regex("^ab", RegexOptions.Multiline) '正则表达式
Dim matchesFound As MatchCollection
matchesFound = matchesRegex.Matches("ab123ef" + Chr(13) & Chr(10) + "ab234ef") '搜索所有匹配
For Each match As Match In matchesFound
MsgBox(match.Value)
Next match
End Sub
Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
Dim matchesRegex As New Regex("ef$", RegexOptions.Multiline) '正则表达式
Dim matchesFound As MatchCollection
matchesFound = matchesRegex.Matches(TextBox1.Text) '搜索所有匹配
For Each match As Match In matchesFound
MsgBox(match.Value)
Next match
End Sub
Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
Dim matchesRegex As New Regex("ef$", RegexOptions.Multiline) '正则表达式
Dim matchesFound As MatchCollection
matchesFound = matchesRegex.Matches("ab123ef" + vbLf + "ab234ef") '搜索所有匹配
For Each match As Match In matchesFound
MsgBox(match.Value)
Next match
End Sub