On Apr 5, 12:33 pm, Andrew Johnson <ajohn... / cpan.org> wrote: > anon1m0us wrote: > > > 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, > > Use the String#[] method with a regex to just return the portion > following > the dashes, and split that: > > result_of_na_citrix = `net group na-citrix > /dom`[/-+\n(.*)/m,1].split(" ") > > cheers, > andrew > > -- > Posted viahttp://www.ruby-forum.com/. I'd suggest: separator = "------------------------------------------------------------------------------- \n" junk,users = `net group na-citrix /dom`.split(separator) user_array = users.split(' ') YMMV Cheers Chris