Click here to Skip to main content
15,886,110 members
Please Sign up or sign in to vote.
4.00/5 (1 vote)
See more:
hai,
how i can Separate meta characters and word using boost library.This my code

code:
C#
boost::regex patternexpression("\\W+",boost::regex_constants::icase|boost::regex_constants::normal);
    std::string stringa ("Dear %1244,{Customerid:D}hfsduihui{Customerid:D}sd u");
    boost::sregex_token_iterator k(stringa.begin(), stringa.end(), patternexpression,0);
    boost::sregex_token_iterator l;

C#
while(k != l)
    {
        std::string temp1 = *k;
        CString m_strConvertstring1(temp1.c_str());
        AfxMessageBox(m_strConvertstring1);
        k++;
    }

This code only split in word and how can split meta characters
Thanks for advance
Posted
Updated 27-Mar-11 23:16pm
v3

1 solution

This is solution code

boost::regex patternexpression("\\w+|\\W+",boost::regex_constants::icase|boost::regex_constants::normal);
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900