From: Harry Date: 2007-04-05T23:02:50+09:00 Subject: Re: Capture information with a split and maybe a match? On 1/17/07, anon1m0us wrote: > However, there is a bunch of garbage (stuff that I do not need to > capture) before the names of the users are listed. Here is an example > > The request will be processed at a domain controller for domain > abc.com. > > Group name NA-CITRIX > Comment Owner:John Doe > > Members > > ------------------------------------------------------------------------------- > The list of users begins here. > > > I need to get the list of users ONLY. Basically, to capture info AFTER > the dashes -----------. I did a 20.times do, but each group has a > different information. The ONLY consistent thing is the list of users > that start AFTER the dashes, > > > If I understand your question, something like this should help. str = "Group name NA-CITRIX\nComment Owner:John Doe\nMembers\n" + "-----------------------------------------------------" + "--------------------------\nThe list of users begins here." str =~ /.*?-{3,}.*?(\w.*)/m puts $1 Look into regular expressions and adjust as necessary. http://www.rubycentral.com/book/tut_stdtypes.html#S4 Harry -- http://www.kakueki.com/ruby/list.html Japanese Ruby List Subjects in English