From: Robert Klemme Date: 2009-08-31T17:33:29+09:00 Subject: Re: Regex: Get Class Name 2009/8/31 Ryan Davis : > > On Aug 31, 2009, at 00:37 , Robert Klemme wrote: > >> >> I'd probably do >> >> /::CLASS_NAME\s*=\s*"([^"]+)"/ > > I'd generally agree with that, but as I told the OP in IRC, in this case I > think it is better to think outside the box: > > name = src[/(\w+)::CLASS_NAME\s*=/, 1] > > Since that is the real name, it makes more sense to me. Ah, that wasn't obvious from the original posting. Btw, this looks suspiciously like someone is trying to model dynamic language features in C++. How simple that would be in Ruby name = any_class.name :-) Kind regards robert -- remember.guy do |as, often| as.you_can - without end http://blog.rubybestpractices.com/