From: "Ara.T.Howard" Date: 2005-07-28T02:13:36+09:00 Subject: Re: ctype / isprint ? On Thu, 28 Jul 2005, Daniel Brockman wrote: > Hi Hadmut, > >> what's the best way to check whether a String consists of >> printable characters only? (In C: isprint from ctype) >> >> Maybe would be nice to have the ctype classes as patterns >> in the regular expressions. > > It's your lucky day: > > "a b c" =~ /\A[[:print:]]*\z/ #=> 0 > > "a \0 c" =~ /\A[[:print:]]*\z/ #=> nil is that locale senstive? -a -- =============================================================================== | email :: ara [dot] t [dot] howard [at] noaa [dot] gov | phone :: 303.497.6469 | My religion is very simple. My religion is kindness. | --Tenzin Gyatso ===============================================================================