From: Brian Candler Date: 2009-09-02T21:02:09+09:00 Subject: Re: regex issue confusing Ahmet Kilic wrote: > This is OK > line[/\sclass\s(\w+)/, 1] > but > line[/\s#include\s(\w+)/, 1] > this is not. > > why??? please help. "Not OK" by what definition? Try posting an irb transcript which demonstrates your problem with sample data. It looks OK to me: >> line = "foo #include bar baz" => "foo #include bar baz" >> line[/\s#include\s(\w+)/, 1] => "bar" >> -- Posted via http://www.ruby-forum.com/.