ARTICLE DETAIL

资讯详情

深耕编程入门与网站建设的一线实战洞察。

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

快速掌握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); } } } }
返回列表