Click here to Skip to main content
14,732,982 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:
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;

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 28-Mar-11 0:16am
v3

1 solution

This is solution code

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

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