From: Ahmet Kilic Date: 2009-09-02T22:39:07+09:00 Subject: Re: regex issue confusing Glenn Jackman wrote: > At 2009-09-02 08:02AM, "Brian Candler" wrote: >> >> 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" > > require 'mind_reading' > > Perhaps the line is something like: #include > in which case the angle bracket gets in the way. > > Ahmet, do you want: > > line[/\s*#include\s+['"<]?(\w+)/, 1] # => "stdio" > > ? I am still learner. really sorry. I did not really recognize it. -- Posted via http://www.ruby-forum.com/.