Hi Im struggling a bit with this, basically I want to find an email address in a message body
i have played with regex but thats not what is needed! As basically I want to search for an Email address in a string not validate one!
I found this VB.net code here http://www.freevbcode.com/ShowCode.asp?ID=9434 and it sounds perfect but i cant convert it
Any Help
Thanks
i have played with regex but thats not what is needed! As basically I want to search for an Email address in a string not validate one!
I found this VB.net code here http://www.freevbcode.com/ShowCode.asp?ID=9434 and it sounds perfect but i cant convert it
B4X:
Public Function FindEMailAddressesInStr(ByVal StringWithEmails As String) As List(Of String)
Dim emailList As New List(Of String)
Dim RegExMatch As Text.RegularExpressions.MatchCollection = _
System.Text.RegularExpressions.Regex.Matches(StringWithEmails, _
"\w+([-+.']\w+)*@\w+([-.]\w+)*\.\w+([-.]\w+)*")
For i As Integer = 0 To RegExMatch.Count - 1
If emailList.Contains(RegExMatch(i).Value) = False Then
emailList.Add(RegExMatch(i).Value)
End If
Next
Return emailList
End Function
Any Help
Thanks