Forum Moderators: coopster & phranque

Message Too Old, No Replies

Finding all "special characters", Perl

I lost the function name

         

mdharrold

10:35 pm on Jul 15, 2002 (gmt 0)

10+ Year Member



I know there is a Perl function to remove all "special characters" ie: !@#$%^&*(), etc.

I just don't remember it's name.

amoore

12:08 am on Jul 16, 2002 (gmt 0)

10+ Year Member



If you just want to remove them, you can use something like:
s/[^\w\d]//g
which removes everything that's not a letter, numeral, or a "_" (underscore).

If you want to URL encode them, look into the URI::Escape module.

If you want to HTML encode them, look into HTML::Entities module.

Hope it helps.

-Andy

mdharrold

12:17 am on Jul 16, 2002 (gmt 0)

10+ Year Member



That works too.
Thanks, amoore.

I could have dreamed it, but it seems there was a meta function in Perl that did the same thing. I could be completely off base.