问题
How do I extract an email address from a string?
xxx my@email.com yyy
xxx and yyy can be any length, any character. The email address is delimited by spaces.
回答1:
One possibility:
sString = "my1@email.com xxx my2@email.com yyy my3@email.com"
asString = Split(sString, " ")
For i = 0 To UBound(asString)
If asString(i) Like "*@*.*" Then
sEmail = sEmail & "," & asString(i)
End If
Next
MsgBox Mid(sEmail, 2)
来源:https://stackoverflow.com/questions/14977200/extract-email-address-from-string-with-variable-length