How would I construct regex so I can perform replacements like these:
abcdef[Backspace][Backspace][Backspace]->abc[Backspace][Backspace]-> (empty string)
Currently, I’m trying to replace backspaces one-by-one in a loop. Is there another way?
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.
Just for the sake of completeness, here is a solution using a negative lookbehind (the one that you probably intended to use yourself):
And replace with an empty string. Do this in a loop. If you are using Java or there are some other circumstances that require escaping of backslashes, double the two backslashes.