编程语言

img iwebsms

从字符串中获得电子邮件数组

发表于2004/9/28 19:31:00  1401人阅读

    '从字符串中获得电子邮件数组

    Function GetMailListFromStrStream(ByVal StrStream As String) As ArrayList

        Dim Re As System.Text.RegularExpressions.Regex

        Dim RegStr As String = "[a-zA-Z0-9]+@([a-zA-Z0-9]+/.)+[a-zA-Z0-9]+" '电子邮件

        Dim MailList As System.Text.RegularExpressions.MatchCollection = Re.Matches(StrStream, RegStr)

        Dim i As Integer : Dim TmpArrayList As New ArrayList

        For i = 0 To MailList.Count - 1

            If Not TmpArrayList.Contains(MailList.Item(i).ToString) Then

                TmpArrayList.Add(MailList.Item(i).ToString)

            End If

        Next

        Return TmpArrayList

    End Function
阅读全文
0 0

相关文章推荐

img
取 消
img