I have a regular expression that replaces all the special characters% (for finding a database using LIKE). It looks like this:
$string =~ s/[^ a-zA-Z0-9]/%/g;
However, I do not know how to change this expression to replace all the required special EXCEPT characters for the first in the line. Therefore, if my line looks like
"&Hi I'm smart(yeah right...)"
it will be
"&Hi I%m smart%yeah right%%%%"
(The first "&" is also being replaced right now).
Can anyone help?
source share