From: Richard Latter (richard_l_at_[hidden])
Date: 2004-05-17 18:31:29


Hello All,

I'm probably missing something obivous here.....So please fogive me if it's
a basic error.

I am using regex for the first time on MSVC 6 and would like to create a
simple function that could pass in a string and an expression to do a
regular match on it. I believe I have successfully compiled this library,
but I don't understand why either of these simple functions are not
working....

 bool TestStr (std::string& szExpr, const std::string& szSearch)
{
 bool bResult=false;

 boost::regex cExpr(szExpr);

 bResult = boost::regex_match(szSearch, cExpr);

 return bResult;
}

or

bool TestStr2 (std::string& szExpr, std::string& szSearch)
{
  return boost::regex_match(szSearch, boost::regex(szExpr));
}

After debugging these routines, it appears thta the boost::regex declaration
fails (at least for the first function) returning a Kernel32.dll exception
with some kind of address.

The credit card example implies that the search and the regex example I have
observed keeps the regex expressions as constansts inside the function, but
I would like to be able to parse in my own string

Questions?

1. Wht doesn't any of the functions work?

2. Is there a tutorial outside of the regex library I could look at.

3. I would be interested to know if anyone had any POSIX regex examples....

Many thanks in advance,

Richard