From: Bertram Scharpf Date: 2007-07-06T17:02:16+09:00 Subject: Re: Pattern Matching Problem Hi, Am Freitag, 06. Jul 2007, 12:27:40 +0900 schrieb Morton Goldberg: > On Jul 5, 2007, at 8:50 PM, Ari Brown wrote: > > > when line =~ /^(.+)$/ > > write_file.puts('"#{$1}"') > > Others have pointed out a problem with your case statement, but I > think there's another problem here -- your #{$1} substitution isn't > going to work in single-quoted string. Further, the grouping is superfluous. when /^.+$/ then do_sth_with $& will do. As `line' will alwas contain a single newline character at the strings end and as /./ will never match that, even when /.+/ then will do. Bertram -- Bertram Scharpf Stuttgart, Deutschland/Germany http://www.bertram-scharpf.de