首页 诗词 字典 板报 句子 名言 友答 励志 学校 网站地图
当前位置: 首页 > 教程频道 > 网站开发 > asp.net >

劳驾写个正则

2013-02-25 
麻烦写个正则/html/12175/info_show_12175250.html我要截取 12175250,就是info_show_与 .html之间的数字[

麻烦写个正则
/html/12175/info_show_12175250.html

我要截取 12175250,就是info_show_与 .html之间的数字
[解决办法]
(?is)(?<=info_show_)\d+(?=\.html)
[解决办法]
string value = Regex.Match(@"/html/12175/info_show_12175250.html", @"info_show_(\d+)\.html").Groups[1].Value;
[解决办法]

string s = "/html/12175/info_show_12175250.html";
string r = Regex.Match(s, @"(?i)/info_show_(\d+)\.html").Groups[1].Value;
Response.Write(r);

热点排行