B
Bryan Coon
I need to remove unsafe characters from a filename, and replace them all
with underscores.
The characters I need to search for and replace are:
!@#$%^*()'"{}[]<>
How do I search and replace for any of the group of special characters
like this?
I tried $filename =~ s/[\!\@\#\$\%\^\*\(\)\{\}\[\]\'\"\<\>]/_/g;
But I dont think they all need to be escaped and Im not sure this is the
right format anyways.
Thanks,
B
with underscores.
The characters I need to search for and replace are:
!@#$%^*()'"{}[]<>
How do I search and replace for any of the group of special characters
like this?
I tried $filename =~ s/[\!\@\#\$\%\^\*\(\)\{\}\[\]\'\"\<\>]/_/g;
But I dont think they all need to be escaped and Im not sure this is the
right format anyways.
Thanks,
B