0

i am trying to use boost regex_match to check if astring is match of specific string in function bellow .

here is my code :

bool findCauseInIgnoreSet(string cause_name) { cout << "finding ignore_cause " << cause_name << endl; boost::regex ignore_cause_regex("pll[0].lock_lost_counter"); cout << "boost:regex ignore_cause_regex(*it) " << ignore_cause_regex <<endl; if (boost::regex_match(cause_name,ignore_cause_regex)) { cout << "we found a match for warning cause " << endl; return true; } } return false; 

when i call findCauseInIgnoreSet("pll[0].lock_lost_counter") in my main function i never get match , is there any restriction regarding special chars like "[" or "_".

thanks in advance.

2
  • i need to add this change when i call findCauseInIgnoreSet ? , or i need to do the change in my function aswell . Commented Nov 15, 2016 at 18:53
  • I was wrong about the escaping. I found some duplicate that will help you. Commented Nov 15, 2016 at 19:43

0

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.