Dr.Ruud wrote:
> "John W. Krahn" schreef:
>>Rob Dixon:
>>>Grant:
> 
>>>>Hello, can you guys show me how to convert each non-alphanumeric
>>>>character in a string to a space, and then convert any number of
>>>>consecutive spaces in the string to a single space?
>>>$text =~ s/[^[:alnum:]]/ /g;
>>>$text =~ s/\s+/ /g;
>>$text =~ s/[[:^alnum:]\s]+/ /g;
> 
> Isn't \s already part of [[:^alnum:]]?

Oops, yes, I was wrong.  :-)


John
-- 
Perl isn't a toolbox, but a small machine shop where you can special-order
certain sorts of tools at low cost and in short order.       -- Larry Wall

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


Reply via email to