I am trying to replace all characters expect below mention characters with space in Apex
[A-Z a-z 0-9-,.&/'@()+# $: ]
String customerName = jo&hn<>ji'o;
String AccName = customerName.replaceAll('[^0-9a-zA-Z\\&.,'-/@+():$#]',' ');
system.debug('AccName' + AccName);
But when I am trying to add single quote ' in the regex I am getting error. can anyone help me on this issue.
Thanks In Advance!!