龙盟编程博客 | 无障碍搜索 | 云盘搜索神器
快速搜索
主页 > 软件开发 > VC开发 >

VC中使用SCRIPT 正则写的LRC歌词分析类(2)

时间:2009-12-30 15:42来源:未知 作者:admin 点击:
分享到:
al= (pMatch-GetItem(0)).bstrVal; } //--------------------- /* 短整型(int) i = atoi(temp); 长整型(long) l = atol(temp); 浮点(double) d = atof(temp); */ regExpPtr-PutPattern("[offset:(-?d+)]");
            al= (pMatch->GetItem(0)).bstrVal;
        }
        //---------------------
        /*
        短整型(int)
        i = atoi(temp);
        长整型(long)
        l = atol(temp);
        浮点(double)
        d = atof(temp);
        */
        regExpPtr->PutPattern("[offset:(-?d+)]");
        matches = regExpPtr->Execute((const char * )Text); //用指针要出错
        if(matches->GetCount()>0)
        {
            pMatch=((IMatch2Ptr)matches->GetItem(0))->GetSubMatches();//SubMatches;
            by= (pMatch->GetItem(0)).bstrVal;
            try
            {
                oTime=float(atof(by));
            }catch(...){};
        }
        //-----------------------------------------
        regExpPtr->PutPattern("[by:([^[]:]+)]");
        matches = regExpPtr->Execute((const char * )Text); //用指针要出错
        if(matches->GetCount()>0)
        {
            pMatch=((IMatch2Ptr)matches->GetItem(0))->GetSubMatches();//SubMatches;
            by= (pMatch->GetItem(0)).bstrVal;
        }

        regExpPtr->PutPattern("[d+:[d.]+]");
        matches = regExpPtr->Execute((const char * )Text); //用指针要出错
        if(matches->GetCount()>0)
        {
            isLrcFile=TRUE;
        }
        else
        {
            isLrcFile=FALSE;
        }
        pMatch=NULL;
        matches=NULL;
        regExpPtr=NULL;
        //"[d+:[d.]+]"

    }
    //catch(_com_error& e)
    //{
    //}
    catch(...)
    {
    }
    CoUninitialize();

精彩图集

赞助商链接