-3

why regex_search(line, smatch, tofind) don't find the expression "toto (titi)" because of the bracket? Without bracket it works. How to remplace ( by a pattern that match this?

πάντα ῥεῖ
  • 1
  • 13
  • 116
  • 190
aez
  • 27
  • 1
  • 6

1 Answers1

-1

You have to escape parenthesis (there are used for grouping):

"toto \\(titi\\)"

or, with raw string (C++):

R"(toto \(titi\))"
Jarod42
  • 203,559
  • 14
  • 181
  • 302