正则表达式,获取命名结果

string pattern = @"http://www.rakuten.ne.jp/gold/(?<shopcode>[\s\S]*?)/";
Match _match = Regex.Match(shopURL, pattern, RegexOptions.IgnoreCase | RegexOptions.Compiled);
if (_match.Success)
{
return _match.Result("${shopcode}");
}
else
return string.Empty;

posted @ 2014-04-16 15:32  xiaofoyuan  阅读(528)  评论(0编辑  收藏  举报