Dan wrote: : how can i substitute, or remove anything that's not an : alphanumerical character in a string?
my $string = "AbCdEF1246Hfn \n"; $string =~ tr/A-Za-z0-9//cd; print qq{"$string"}; You can read more about tr/// in the "perlop" file in the docs. : i.e: : $string = "AbCdEF1246Hfn \n"; : $string =~ s/[^a-z][^A-Z][^0-9]//g; : : though to me, that would say: : (replace anything that's not a lower case letter as the first : char) then (replace anything that's not an upper case letter : as the second char) then (rpelace anything that's not a number : as the third char). : : or is this right? It says replace any three character sequences where the first character is not lower case, the second character is not upper case and the final character is not a digit. HTH, Charles K. Clarkson -- Mobile Homes Specialist Free Market Advocate Web Programmer 254 968-8328 Don't tread on my bandwidth. Trim your posts. -- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] <http://learn.perl.org/> <http://learn.perl.org/first-response>