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;} 奇怪的PostMessage ListCtrl表头响应函数问题 求标准 可靠 迅速的销毁线程的方法 md5 加密用DLL 使用webbrowser2控件,刷新一个多框架的网页时,如何判断全部完成了? 关于sql的like 高手啊,高手啊,请帮帮我啊,求饼状图的实现啊! 问个很弱的问题 如何自定义 sql 字段的增长规律,请帮忙!!!!!!! \\\\\\\\\\\\\\\\\ 寻找 “ 计算机专业词典”,要求:准确、权威、最新(2001年版本),考MCSE用的。40分。谢谢 /////////////////////////////// 调试代码对话框 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;
}