Boost logo

Boost Users :

From: Manish Madan (mmadan_at_[hidden])
Date: 2004-05-05 03:10:44


Hello,
     I'm new to boost and I had one question. I'm trying to match
strings against regular expressions that are expected to be posix
extended regular expressions. But for some reason, the modifier ^
doesn't seem to be working. For example, when I try to match "Manish"
against "^[mM]anish.*", I am returned false. What am I doing wrong?
 
Here's my short matching function:
 
bool MatchRegExp(const std::string& matchThis, const std::string&
againstThis)
{
 try
 {
  const boost::regex e(againstThis);//,
boost::regex_constants::icase);
  return boost::regex_match(matchThis, e,
boost::regex_constants::extended);
 }
 catch(boost::bad_expression be)
 {
  return false;
 }
 
}
 
thanks
Manish



Boost-users list run by williamkempf at hotmail.com, kalb at libertysoft.com, bjorn.karlsson at readsoft.com, gregod at cs.rpi.edu, wekempf at cox.net