Mumia W. wrote:
> On 08/25/2006 04:26 PM, Jim Schueckler wrote:
>> Hi,
>> I need to remove all characters from a string except 'a'..'z', 'A'..'Z',
>> and '0'..'9'.
>> [...]
> 
> $newstring = $oldstring;
> $newstring =~ s/[^[:alnum:]]+//g;
> 
> Everything that's not alphanumeric gets zapped to nothing.

[:alnum:] will also include characters outside the range of 'a'..'z',
'A'..'Z', '0'..'9' depending on your locale.  (If that is what the OP wants?)


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