快速掌握C#语言基础知识点(25.正则表达式)

发布时间:2026/7/21 16:38:37
快速掌握C#语言基础知识点(25.正则表达式) 关注我的动态using System.Text.RegularExpressions; namespace _25.正则表达式 { internal class Program { static void Main(string[] args) { //匹配邮箱地址 var pattern [0-9a-zA-Z\._\-][0-9a-zA-Z\.)]; var orgString hello, fzp_1163.com, to fzp-2qq.com; var matches Regex.Matches(orgString, pattern); foreach (Match match in matches) { Console.WriteLine(match.Value); } } } }