Boost logo

Boost :

Subject: [boost] Why my subexpression doesn't work in Regex
From: Qihong Wang (qihongwang_at_[hidden])
Date: 2009-03-17 22:33:12


I'm a new boost and regex user. I tried a c++ regex sample as follows

  regex pattern("banan\\(an\\)*a");
  string str = "bananana";

  if(regex_match(str, pattern))
     cout<<"---- pattern matched ----"<<endl;
     cout<<"---- pattern unmatched ----"<<endl;

To my surprise, the it printed out pattern unmatched. If I change str to
the result is pattern matched. Feels like boost.Regex doesn't treat ( ) as
Any idea?


Qihong Wang

Boost list run by bdawes at, gregod at, cpdaniel at, john at