From: Robert Klemme Date: 2007-04-17T23:40:04+09:00 Subject: Re: Regular expression help On 17.04.2007 16:08, Guest wrote: > I have a line such as: > > #define BLAH 10 > > or > > #include "BLAH.h" > > and I'm going around in circles trying to just get the 'include' or > 'define' bit...anyone can help me? >> ["#define BLAH 10", '#include "BLAH.h"'].map {|s| s[/^#(\w+)/, 1]} => ["define", "include"] HTH robert