可能重复:
What is the best regular expression for validating email addresses?
您好
如何查找带有正则表达式的电子邮件?
"sdafsad@asdfsa.com" "sdaf-sad@asdfsa.com" "sdaf-sad@asdfsa.com" "sdaf-sad@asdf-sa.com" "sdaf_sad@asdf-sa.com"
另外,我如何才能找到这些物品:
track0; (any track number); track50 (any track number); Track 0 (any track number); Track 10 (any track number); Track10 (any track number);
答案 0 :(得分:1)
\b[A-Z0-9._%+-]+@[A-Z0-9.-]+\.[A-Z]{2,4}\b
答案 1 :(得分:0)
1)直接来自Microsoft:How to match a pattern by using regular expressions and Visual C#
using System.Text.RegularExpressions;
Regex emailregex = new Regex("(?<user>[^@]+)@(?<host>.+)");
Match m = emailregex.Match(s);
2)您想要验证具有该格式的所有条目,还是只想获得“(任何曲目编号)”值?
答案 2 :(得分:0)