主页
文章
交流
项目
购买
客服

 

deelx使用连续查找的时候会很卡

欢迎讨论 » 表达式交流 » deelx使用连续查找的时候会很卡 »


   

deelx使用连续查找的时候会很卡
发表:wxd,2010-1-6 14:59:54

回复

 
我在VS2008中使用deelx,主要是用于匹配网页源代码中的iframe标签和script标签及其src内容,类似网易这种大站,首页源代码比较多,类似iframe和script这种标签也比较多,所以在使用while循环进行匹配的时候,会很卡,但是使用别的正则表达式库的时候不会,不知道deelx能否在连续查找方面有更好的方式呢?

   

Re: deelx使用连续查找的时候会很卡
发表:史寿伟,2010-1-7 15:32:04

回复

 

   

Re: deelx使用连续查找的时候会很卡
发表:wxd,2010-1-7 15:48:32

回复

 
恩,试过了,也是挺卡的,不知道你可否留下联系方式如QQ等?

   

Re: deelx使用连续查找的时候会很卡
发表:史寿伟,2010-1-7 20:46:46

回复

 
我的 QQ 是 7272209 ,
我的其他联系方式,可点击本网站右上角的“关于”。

   

Re: deelx使用连续查找的时候会很卡
发表:wxd,2010-1-8 13:19:40

回复

 
char* text=(char*)(LPCTSTR)m_source;
static CRegexpT <char> regexp("((<i?frame|<script)[^>]+src[ ]*=[ ]*[""']?[ ]*([^""' >]+)[""' ]?[^>]*>)");
MatchResult result = regexp.Match(text);
while( result.IsMatched() )
{
        CString strTemp;
        strTemp.Format("%.*s\n", result.GetEnd() - result.GetStart(), text + result.GetStart());
    result = regexp.Match(text, result.GetEnd());
    int    nItem = m_list.GetItemCount();
    m_list.InsertItem(nItem,"test");
    m_list.SetItemText(nItem,1, "test");
    m_list.SetItemText(nItem,2,strTemp);
}
针对网页代码比较短的还可以,但是针对类似网易这种比较长的代码,会很卡


第 1 页,共 1 页: 第一页 上一页 下一页 最后一页


相关赞助商链接

 
 

RegExLab.com © 2005 - 2009  渝ICP备05015140号