Im sure this is easily done with regex, just haven’t had much experience.
EG, given
char *mystring= blah blah <i>(this is not needed)</i> (Nor this). This is.
it would return
char *return_str = blah blah . This is.
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
Even though your question is tagged
regex, a regex is not the correct solution.What you probably want to do is write a simple pushdown automaton.
Here is a really simple example:
I’m not even sure that this qualifies as a pushdown automaton because it uses a simple counter and not a stack, but the concept is similar.
This one only does the parentheses, but it should be simple enough to demonstrate the technique.