I needed a little help writing a function in java that does the follow for escaping, I want to use regular expressions, I need the following characters to be replaced by a “~”
I posted it in beginners, but i think it is more fitting in this area.
The special characters are replaced as follows:
1. Newline, backspace, Control-M, carriage return, vertical tab characters are each replaced with "~"
2. Double quotes (") are replaced with single quotes (')
3. Then single quotes are escaped by inserting a backslash before each one.
Can someone give me a hand writing this? I don’t know regular expressions so it’s difficult for me to get going on this.
Please do not cross-post the same question in multiple forums. It wastes people's time when multiple redundant conversations take place. Please read this for more information.