Categoria: VB.NET
Questa funzione serve per estrarre tutti gli indirizzi email contenuti in una stringa di testo passata come argomento.
Ritorna un array contenente gli indirizzi email trovati.
Imports System.Text.RegularExpressions
Private Function TrovaEmail(ByVal testo As String) As String()
Dim mc As MatchCollection = Regex.Matches(testo, _
"([a-zA-Z0-9_\-\.]+)@([a-zA-Z0-9_\-\.]+)\.([a-zA-Z]{2,5})")
Dim trovati(mc.Count - 1) As String
For i as Integer = 0 To trovati.Length - 1
trovati(i) = mc(i).Value
Next
Return trovati
End Function
Non ci sono commenti per questa pagina. Vuoi essere il primo a postare un commento?
Segnala questa pagina: