-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?

πάντα ῥεῖ
  • 85,314
  • 13
  • 111
  • 183
aez
  • 27
  • 1
  • 5

1 Answers1

-1

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

"toto \\(titi\\)"

or, with raw string (C++):

R"(toto \(titi\))"
Jarod42
  • 190,553
  • 13
  • 166
  • 271