On 5/17/07, anon1m0us <anon1m0us / yahoo.com> wrote: > > I need to obtain the group name From after CN= until the first comma. > I tried scan and match. I can't get it right. > > > Is this what you are looking for? str = "CN=Domain Users,CN=Users,DC=testdc,DC=testroot,DC=test,DC=com" str =~ /CN=(.*?),/ p $1 Harry -- A Look into Japanese Ruby List in English http://www.kakueki.com/