From: Ammar Ali Date: 2010-10-28T19:30:07+09:00 Subject: Re: ctype functionality without a gem? On Thu, Oct 28, 2010 at 1:02 PM, Anton Bangratz wrote: >> I came up with this quick >> solution for now, http://gist.github.com/650968 > > This is similarily fragile. If you are only testing for one character, > it seems good, if you are going to test for strings, it will not be > enough. I do only need to test individual characters. Extending the code to match entire strings should be easy: /^[[:alnum:]]+$/ > Also, the whole solution is not necessarily fast - I do love regular > expressions, but I would search on for other methods to meet your > requirements. It really depends on what your goal is. If it is about > bit streams, you might want to look into bit-struct or similar > approaches that use Array#pack and String#unpack. I agree, and wish this was built-in. Interesting suggestions. Thanks. Regards, Ammar