R
Richard Latter
Hello All,
I am a newbie to the Boost library and I have a question about a simple
function. All I would like to do is to create a simple function that can
test strings using regular expressions. I've written this function which
appears to work on the first pass and then fails on the second with the
following message.
Unhandle exeption in Credit Card Example.exe (KERNEL32.DLL) 0x(Some
address): Microsoft C++ Exception.
My function is as follows....
bool TestStr (std::string szExpr, std::string szSearch)
{
bool bResult=false;
boost::regex *cExpr = new boost::regex(szExpr);
bResult = boost::regex_match(szSearch, *cExpr);
delete (cExpr);
return bResult;
}
Questions!
1. Why is this failing all the time?
2. Why in the example given in the RTL is a constant? This implies that
the the regex object cannot be changed at run-time, which is the opposite to
what I would like to do.
3. Are there any examples or tutorials outside of the main library tutorial
I could look at? Are there any newsgroups on this?
4. Can anyone give an example of a simple POSIX calls for string matching?
Please forgive me as I'm a newbie to all of this. Any help would be
gratefully appreciated.
Regards,
Richard
I am a newbie to the Boost library and I have a question about a simple
function. All I would like to do is to create a simple function that can
test strings using regular expressions. I've written this function which
appears to work on the first pass and then fails on the second with the
following message.
Unhandle exeption in Credit Card Example.exe (KERNEL32.DLL) 0x(Some
address): Microsoft C++ Exception.
My function is as follows....
bool TestStr (std::string szExpr, std::string szSearch)
{
bool bResult=false;
boost::regex *cExpr = new boost::regex(szExpr);
bResult = boost::regex_match(szSearch, *cExpr);
delete (cExpr);
return bResult;
}
Questions!
1. Why is this failing all the time?
2. Why in the example given in the RTL is a constant? This implies that
the the regex object cannot be changed at run-time, which is the opposite to
what I would like to do.
3. Are there any examples or tutorials outside of the main library tutorial
I could look at? Are there any newsgroups on this?
4. Can anyone give an example of a simple POSIX calls for string matching?
Please forgive me as I'm a newbie to all of this. Any help would be
gratefully appreciated.
Regards,
Richard