From: Logan Capaldo Date: 2006-06-26T14:50:50+09:00 Subject: Re: Unicode roadmap? On Jun 26, 2006, at 1:24 AM, Daniel DeLorme wrote: > I think the real issue is not technical but rather a problem of > perception and education. Ever since C-style strings, programmers > have learned to view a string as an array of chars. So when we need > to do char-string manipulation, we resort to pointer arithmetic > when it fact the "correct" and ruby-native way of manipulating > strings is with regular expressions. Instead of giving in to this > old string-as-array mentality, maybe we should teach people to use > regular expressions? Hmmm, probably impossible. Regular expressions are a very powerful tool, but they do not describe the entire set of operations one would reasonably want to perform on a string. Or perhaps they do but in a needlessly complex way. I want to get the first letter (character?) of a sentence, in pure regexp terms I'd do this: str.match(/\A./)[0] It's needlessly cryptic. Note that I'm not trying to make a commentary on whether or not character string/byte string should be separate, just trying to point out that "use regular expressions" shouldn't always be the answer.