From: Alpha Chen Date: 2008-05-16T07:00:07+09:00 Subject: Re: The Turing Machine (#162) Thanks for the writeup! But a small nitpick... =) On May 15, 11:26 am, Matthew Moss wrote: >       puts @tape.sort.map {|_,v| v}.join.gsub(/^_*|_*$/, '') > > "useful" content of the tape is displayed. Chen's regular expression > (slightly corrected in the code shown above), removes all blanks > immediately after the start of the line _or_ immediately preceding the > end of the line. Shouldn't the regex return "a" instead of "a_b" for "_a_b_"?