Jim Schueckler wrote:
> Hi,

Hello,

> I need to remove all characters from a string except 'a'..'z', 'A'..'Z',
> and '0'..'9'.
> 
> Could somebody please tell me the magicWords for:
>   $newstring = magicWords($oldstring);    ???
> 
> I am absolutely new to Perl and regular expressions, so please don't
> assume I know anything that everybody else knows. :-)

Fortunately you don't need a regular expression to do what you want:

( my $newstring = $oldstring ) =~ tr/a-zA-Z0-9//cd;



John
-- 
use Perl;
program
fulfillment

-- 
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
<http://learn.perl.org/> <http://learn.perl.org/first-response>


Reply via email to