--- "John W. Krahn" <[EMAIL PROTECTED]> wrote:
> How can y give s sbstition order of the kind
> @string=~s/nonalfanum//g;

Assuming @string was intended to be an array of values to scrub....
otherwise, use $string.

> in these two cases?
> 1-wich will search and replace with "" (empty char) all nunnumeric
> or nonalphabetic chars?

Again, assuming @string was intended to be an array of values to scrub,

  y/[A-Za-z0-9]/[A-Za-z0-9]/d for @string; 

This replaces alphas and digits with themselves, and deletes everything
else; it does so for each item in @string iteratively.

> 2-wich will search and replace with "" (empty char) all nunnumeric
> or nonalphabetic chars with the exception of "-","_","@","." ?
> 

Same trick, different pattern. Just add the additional chars, but watch
the minus....put it at the end so it isn't part of a range like a-z.

  y/[a-zA-Z0-9_@.-]/[a-zA-Z0-9_@.-]/ for @string;

Just make SURE you get the order the same.


__________________________________________________
Do you Yahoo!?
Yahoo! Shopping - Send Flowers for Valentine's Day
http://shopping.yahoo.com

-- 
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to