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

πάντα ῥεῖ
  • 83,259
  • 13
  • 96
  • 175
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
  • 173,454
  • 13
  • 146
  • 250