I have a string containing various characters. From that string I want to remove some characters like tabs and quotes.
I use this php code:
$str = 'RegExr was created by gskinner.com, and is proudly hosted by Media Temple.
The side bar includes a Cheatsheet, full Reference, and Help. You can also Save & Share with the Community, and view patterns you create or favorite in My Patterns.
Explore results with the "Tools below. Replace & List output" custom results. Details\' lists capture groups. Explain des\'cribes your expression in plain English.';
echo preg_replace('/[\cI\t\v\f\"\\\']/', '', $str);
I created a draft on regexr at this link: https://regexr.com/5buva
On that website, the newline character, not specified in regular expression, is left there. But in my php function, it is removed.
I don't want to remove newline character from the string.
How can I fix?