I'm working on a project and I want to remove text between two parentheses in a string. Example:
std::string str = "I want to remove (this)."
How would I go about doing that? I've searched google and stackoverflow an haven't found anything.
I'm working on a project and I want to remove text between two parentheses in a string. Example:
std::string str = "I want to remove (this)."
How would I go about doing that? I've searched google and stackoverflow an haven't found anything.
I'd use a regular expression for that. Check out the link I provided. As for the expression to use the following expression
(\()(?:[^\)\\]*(?:\\.)?)*\)
That guy worked for me.
Conditionally replace regex matches in string
:-)
or :-O
or >:(
All-though effective These expressions are mutually exclusive expressions that not many languages understand but are more commonly used.