From: Ahmet Kilic Date: 2009-09-25T16:53:23+09:00 Subject: Re: Get functions names with regex Josh Cheek wrote: > On Fri, Sep 25, 2009 at 12:54 AM, Ahmet Kilic > wrote: > To see what is going on, you can have the block accept a variable list > of > arguments, then print that out to see what was passed in, something like > this: > > "ab cdef".scan(/(b)(\s*)(?:c)de(f)/).each do |*args| > p *args > end > > Which would print out ["b", " ", "f"] Then you can go and change your > groups around, and see how that affects it. > functs = str.scan(/^\s*function\s*([^(]+)\(([^)]+)/).map do |name,args| > name.gsub!(/\s/,'') > args.gsub!(/\s/,'') > ParsedFunction.new( name , args.split(/;/).map{|arg| arg.split(/:/) } > ) Thanks I think it is clear now. -- Posted via http://www.ruby-forum.com/.