javascript中的正则表达式对象用的哪个COM? javascript中的正则表达式对象用的哪个COM? 解决方案 » 免费领取超大流量手机卡,每月29元包185G流量+100分钟通话, 中国电信官方发货 javascript如果用在ie中,则不需要特别支持,ms的script engine本身就支持了。查阅javascript文档。使用很简单。 不是用在ie中的load dll进来 // regexptest.cpp : Defines the entry point for the console application.//#include "stdafx.h"//ʹÓÃVC++ÒÔ×ÊÔ´µÄ·½Ê½´ò¿ªVBScript.dll£¬ÔÚÆäÖÐÑ¡ÔñTypeLib£¬½«µÚ2¸öTypeLibÊä³öΪregexp.tlb#import "regexp.tlb" no_namespaceint main(int argc, char* argv[]){ CoInitialize(NULL); { IRegExpPtr regExpPtr(__uuidof(RegExp)); regExpPtr->PutGlobal(VARIANT_TRUE); regExpPtr->PutPattern("(\\d+\\.?\\d*|\\.\\d+)"); LPCTSTR testStr = "This 1dd2d"; IMatchCollectionPtr matches = regExpPtr->Execute(testStr);//ÓÃÖ¸ÕëÒª³ö´í int count = matches->GetCount();//count=0 ÅÐ¶Ï matches Ó¦¸ÃÊÇÕýÈ·µÄ for(int i=0; i<count; i++) { IMatchPtr match=matches->GetItem((long)i); if(match) { printf("%s\n",(LPCTSTR)match->GetValue()); } } } CoUninitialize(); printf("Test of using regular expression in VC++!\n"); return 0;} Windows mobile窗口属性的设置问题! VC 和 Excel混合编程如何做 谁帮我解释一下HWND和HINSTANCE [文章] 算法时间复杂度测量 千分寻求老鸟帮一MM修改程序!!!!!!!!!!!!!!!! 用MSCOMM出了DEBUG,现在想改用API,但有几个问题不明白,请各位高手进来帮忙!! ●●请问开发手机程序一般用什么语言?●● 关于ERP的(志同道合者进来聊聊) 带图像预览的文件对话框? mfc 点击向下按键button1到过进度条红色位置 调试代码对话框 CList的嵌套使用
load dll进来
//#include "stdafx.h"
//ʹÓÃVC++ÒÔ×ÊÔ´µÄ·½Ê½´ò¿ªVBScript.dll£¬ÔÚÆäÖÐÑ¡ÔñTypeLib£¬½«µÚ2¸öTypeLibÊä³öΪregexp.tlb
#import "regexp.tlb" no_namespaceint main(int argc, char* argv[])
{
CoInitialize(NULL);
{
IRegExpPtr regExpPtr(__uuidof(RegExp));
regExpPtr->PutGlobal(VARIANT_TRUE);
regExpPtr->PutPattern("(\\d+\\.?\\d*|\\.\\d+)");
LPCTSTR testStr = "This 1dd2d";
IMatchCollectionPtr matches = regExpPtr->Execute(testStr);//ÓÃÖ¸ÕëÒª³ö´í
int count = matches->GetCount();//count=0 ÅÐ¶Ï matches Ó¦¸ÃÊÇÕýÈ·µÄ
for(int i=0; i<count; i++)
{
IMatchPtr match=matches->GetItem((long)i);
if(match)
{
printf("%s\n",(LPCTSTR)match->GetValue());
}
}
}
CoUninitialize();
printf("Test of using regular expression in VC++!\n");
return 0;
}