📄 parsehelper.cpp
字号:
// ParseHelper.cpp: implementation of the CParseHelper class.
//
//////////////////////////////////////////////////////////////////////
#include "stdafx.h"
#include "ParseHelper.h"
#include <boost/regex.hpp>
//////////////////////////////////////////////////////////////////////
// Construction/Destruction
//////////////////////////////////////////////////////////////////////
CParseHelper::CParseHelper()
{
}
CParseHelper::~CParseHelper()
{
}
bool CParseHelper::IsQX_ID_MobilePhone(const char *pszInput, int &iId, CString& strPhone)
{
USES_CONVERSION;
// 清空输入
CString strGender,strAge,strNickname,strBirthday;
wstring wpattern5=L"^QX[\\s\\x23\\x2a\\x2b]*(\\d{1,2})[\\s\\x23\\x2a\\x2b]*(13\\d{9})$"; // QX+1+13501831513
wstring ws(L"");
int len=0,num=0,item=0;
vector<wstring> wl;
bool bmatched=true;
iId=-1;
strPhone="";
ws=A2W(pszInput);
// 进行3字段匹配
boost::wregex we(wpattern5);
num=boost::regex_split(back_inserter(wl),ws,we);
if(2==num)
{
//iId=StrToInt(W2A(wl[0].c_str()));
iId=atoi(W2A(wl[0].c_str()));
strPhone=W2A(wl[1].c_str());
}
else
bmatched=false;
return bmatched;
return true ;
}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -