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

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;

你可能感兴趣的:(正则表达式)