您的位置:首页 > 其它

正则表达式练习题

2012-07-05 23:40 113 查看
1.解析IP

提取数字namespace 提取数字
{
class Program
{
static void Main(string[] args)
{
string str = "hello,2010年10月10日是个好日子。恩,9494.吼吼!886.";
MatchCollection ms = Regex.Matches(str, @"\d+");
foreach (Match m in ms)
{
if (m.Success)
{
Console.WriteLine("{0}\t\r\n", m.Value);
}
}
Console.ReadKey();
}
}
}
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签: