(ASP.NET)在正则表达式中符号"$"代表什么意思?(请参看代码)
protected void Button1_Click(object sender, EventArgs e)
{
string strText = TextBox1.Text;
Regex urlRegex = new Regex(@ "(http:\/\/([\w.]+\/?)\S*) ", RegexOptions.Compiled | RegexOptions.IgnoreCase);
strText = urlRegex.Replace(strText, " <a href=\ "$1\ " target=\ "_blank\ "> $1 </a> ");
Regex mailRegex = new Regex(@ "([a-zA-Z_0-9.-]+\@[a-zA-Z_0-9.-]+\.\w+) ", RegexOptions.IgnoreCase | RegexOptions.Compiled);
strText = mailRegex.Replace(strText, " <a href=mailto:$1> $1 </a> ");
Label1.Text += " <br/> " + strText;
}
[解决办法]
()分组中第一个分组
[解决办法]
$ 匹配字符串的结束
[解决办法]
http://www.cnblogs.com/allenny/archive/2006/03/21/354633.html