0
我需要確認域擴展名是否存在。正則表達式匹配域擴展
到目前爲止,我還沒有能夠得到一個匹配域擴展
凡域名可以有通配符:gmail.com,msn.com,mac.com,comcast.net
DomainPartOfEmail = Right(temp, (Len(temp) - temp.LastIndexOf("@") - 1))
If Regex.IsMatch(DomainPartOfEmail, "*.edu? | *.com? | *.net? | *.org?", RegexOptions.IgnoreCase) Then
ValidDomain = True
End If
你甚至可以省略'。*'(因爲該模式並不固定在輸入字符串的開頭) –