在C#中使用正则表达式
2011-10-20 19:41
211 查看
using System; using System.Collections.Generic; using System.Linq; using System.Text; using System.Text.RegularExpressions; namespace Regular_Expression_1 { class Program { static void Main(string[] args) { Console.WriteLine(@"This will find a match for the regular expresson '[A-Z]\d'."); Console.WriteLine("Enter a test string now."); Regex myRegex = new Regex(@"[A-Z]\d", RegexOptions.IgnoreCase); string inputString = Console.ReadLine(); Match myMatch = myRegex.Match(inputString); Console.WriteLine("You entered the string '" + myMatch.ToString() + "'was found in the string you entered."); Console.ReadLine(); } } }
相关文章推荐
- C#使用正则表达式验证手机号格式是否正确
- [C#][固定格式网页解析]使用正则表达式处理网页的初步体会
- C# 正则表达式的使用详解
- 使用C#与正则表达式分析hao123.com的网址列表
- C#中正则表达式的使用
- C#判断IP地址是否合法函数-使用正则表达式-2个,还有IPAddress
- 正则表达式在c# 与js 中如何使用
- c#使用正则表达式匹配字符串验证URL示例
- 通过代码学习C#&.NET——委托使用(正则表达式替换)
- C#中正则表达式的使用
- c#使用正则表达式
- C#中正则表达式使用介绍
- C#中可以使用正则表达式来过滤html字符
- C#正则表达式使用方法示例
- C#中使用正则表达式验证电话号码、手机号、身份证号、数字和邮编
- C# 使用正则表达式去掉字符串中的数字,或者去掉字符串中的非数字
- C# .net 使用正则表达式去掉字符串中的数字
- C#使用正则表达式读取log4net日志文件
- C#中使用正则表达式验证电话号码、手机号、身份证号、数字和邮编
- c#中使用正则表达式