首页 诗词 字典 板报 句子 名言 友答 励志 学校 网站地图
当前位置: 首页 > 教程频道 > 网站开发 > asp.net >

(ASP.NET)在正则表达式中符号"$"代表什么意思?(请参看代码)解决办法

2012-01-29 
(ASP.NET)在正则表达式中符号$代表什么意思?(请参看代码)protectedvoidButton1_Click(objectsender,Even

(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

热点排行