I did not found a regex for my problem. There are always example-regex for escaping with back-slash.
But I need escaping by doubling the enclosing-character.
Example: ‘o”reilly’
Result: o’reilly
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.
will match a quote-delimited string that may contain double-escaped quotes. So that’s your regex to find those strings.
Explanation:
To now remove the quotes correctly, you could do it in two steps:
First, search for
(?<!')'(?!')to find all single quotes; replace them with nothing.Explanation:
Second, search for
''and replace all with'.