如题:我想从模板页(静态页中通过正则匹配查找出要替换的特殊字符)
静态页中特殊字符如下(红色的):
模板
<html> <head> <title> {TB_Index_Title} </title> <meta http-equiv="Content-Type" content="text/html; charset=gb2312"> </head> <body > <table height="100%" border="0" width="100%" cellpadding="10" cellspacing="0" bgcolor="#eeeeee" style="border:1px solid #000000"> <tr> <td width="100%" valign="middle" align="left"> 内容: {TB_Index_Context}时间: {TB_Index_Date}</td> </tr> </table> </body> </html>
静态页中特殊字符如下(红色的):
模板
<html> <head> <title> {TB_Index_Title} </title> <meta http-equiv="Content-Type" content="text/html; charset=gb2312"> </head> <body > <table height="100%" border="0" width="100%" cellpadding="10" cellspacing="0" bgcolor="#eeeeee" style="border:1px solid #000000"> <tr> <td width="100%" valign="middle" align="left"> 内容: {TB_Index_Context}时间: {TB_Index_Date}</td> </tr> </table> </body> </html>
解决方案 »
- 问个页面和分辨率的问题啊 急~~
- 跪求创新思想 ~~~
- 放入Image空间中的图片如何让它缩小啊?
- 关于dataset的使用求助
- 请教:奇怪的OCI-22053问题
- 新手散分:如何判断在客户端上传文件的路径是否存在?
- ACCESS的Parameter OleDbType枚举对应SQL应该用什么语法.
- 请教一个关于动态绑定datagrid的问题
- 数据查询问题
- 做了一个函数,重载其中的方法 3 个,本地机可以用,但服务器上只有 2 个可用。为什么,最后一个是后来增加的。怎么处理呀
- 请问各位高手!如何在web应用程序中引用dll
- 如何 通过B/S方式 打印 128码。打印机为zebra的。(帮者有分)
string strString = "内容: {TB_Index_Context}时间: {TB_Index_Date} </td> ";
arrStr = macthValue("{TB_Index.*}", strString);
Label1.Text = arrStr[0].ToString();
public string[] macthValue(string regexStr, string htmlStr)
{
MatchCollection mc;
Regex r = new Regex(regexStr);
mc = r.Matches(htmlStr);
int count = mc.Count;
string[] arrStr = new string[count]; for (int i = 0; i < count; i++)
{
arrStr[i] = mc[i].Value;
}
return arrStr;
}
怎么搜出来的是:{TB_Index_Context}时间: {TB_Index_Date}
怎么把那个”时间:“给过滤掉?
{
string[] arrStr = new string[30];
string strString = "内容: {TB_Index_Context}时间: {TB_Index_Date} </td> ";
arrStr = macthValue("(?<value>{TB_Index.*?})", strString); label1.Text = "";
foreach (string s in arrStr)
{
label1.Text += s;
}
}