我有那个代码,它只忽略带有空格的单词,并且它以 + 开头......但我必须只允许点,字母和破折号......我认为它更简单:
Imports System.Text.RegularExpressions
Public Class Contactos
ReadOnly pattern As String = "\s([^+\d\,]+),?"
Private Sub Button1_Click(sender As Object, e As EventArgs) Handles Button1.Click
Dim cadena As String = " " & TextBox1.Text & ","
Dim match As Match = Regex.Match(cadena, pattern)
Do While match.Success
frmMain.ListBox1.Items.Add(match.Groups(1).ToString)
match = match.NextMatch()
Loop
End Sub
End Class
我能做些什么?
谢谢!:)