From: "David A. Black" Date: 2009-07-13T18:48:19+09:00 Subject: Re: The easiest way to separate substrings from a line string --1926193751-1781722216-1247478485=:25721 Content-Type: MULTIPART/MIXED; BOUNDARY="1926193751-1781722216-1247478485=:25721" This message is in MIME format. The first part should be readable text, while the remaining parts are likely unreadable without MIME-aware tools. --1926193751-1781722216-1247478485=:25721 Content-Type: TEXT/PLAIN; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 8BIT Hi -- On Mon, 13 Jul 2009, Dave Burt wrote: > Moving off-topic from the thread, but David Black wrote: >> ... /\w+/ (or maybe /[^\W\d_]+/ or something). > > Do people actually say /[^\W\d_]/ instead of /[a-z]/i? The latter is > much easier for me to read. Does the former include non-latin > word-characters? Yes: >> s = "\u00e9" => "�" >> /\w/.match(s) => # >> /[a-z]/.match(s) => nil Another choice would be: /[[:alpha:]]/ which I believe would do the same thing that my character class did (unless there are some exclusions, inclusions, or edge cases I'm not remembering). David -- David A. Black / Ruby Power and Light, LLC Ruby/Rails consulting & training: http://www.rubypal.com Now available: The Well-Grounded Rubyist (http://manning.com/black2) Training! Intro to Ruby, with Black & Kastner, September 14-17 (More info: http://rubyurl.com/vmzN) --1926193751-1781722216-1247478485=:25721-- --1926193751-1781722216-1247478485=:25721--