in reply to RegEx Character Class
To keep "/", please add "\/"
$code =~ s/[^\/\w"':.;]//g; [download]
Cheers !
--VC
If using alternate delimiters, there's no need to protect '/'.
BTW: this is a perhaps a job better suited for tr///d, except that it doesn't support \w and one would have to hardcode the ranges - and it may even be worse if unicode were involved, but the OP may like to know anyway.