日期:2014-05-20  浏览次数:20864 次

如何用正则表达式将提出所需内容
有这样一段html编码,
<a   href= 'javascript:gotopage(2533768) '   title= '本章字数:2835   更新日期:2007-1-22 '   target=_top> 第一章   色狼下山 </a>
    如何将javascript:gotopage(2533768)中的数字取出

------解决方案--------------------
string str = textBox1.Text;
string pattern = @ "(? <=gotopage\()\d+ ";
Regex regex = new Regex(pattern, RegexOptions.Singleline);
string result = regex.Match(str).Value;
MessageBox.Show(result);