From: Brian Candler Date: 2009-08-31T16:23:18+09:00 Subject: Re: Regex: Get Class Name Ahmet Kilic wrote: > This a C++ class name, > const std::string DRAPBase::CLASS_NAME = "DRAPBase"; > I am writing like this > classname = text.scan(/::CLASS_NAME = (.*?)\s+";/) > but it is not true. You're matching `::CLASS_NAME = ' followed by zero or more characters followed by one or more space characters followed by "; It's the "one or more space characters" which doesn't match. Maybe you meant \S which means non-space character? e.g. classname = text.scan /::CLASS_NAME = "(\S+?)";/ -- Posted via http://www.ruby-forum.com/.