lundi 11 janvier 2021

std::regex with characters \,{,} - How to escape

I am doing something like this

std::regex regex ("\|{|}");

The above throws an exception

regex_error(error_badrepeat): One of *?+{ was not preceded by a valid regular expression.

My question is how do I escape the characters \ . { and } in std::regex ?

Aucun commentaire:

Enregistrer un commentaire