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

类别:.NET开发 点击:0 评论:0 推荐:

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

    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

本文地址:http://com.8s8s.com/it/it43908.htm