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

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

原文地址:https://www.cnblogs.com/xiaofoyuan/p/3668754.html