Drew Olson wrote: > irb(main):009:0> mystring.scan(/CN=([^,]*),/) > => [["test"], ["test1"]] I have a question after studying my own solution for the ruby-wise :) Why does this scan return an array of arrays rather than a simple array of matches? I suppose the OP should really do this if he wants the matches: mystring.scan(/CN=([^,]*),/).flatten Why is this flatten necessary? I'm assuming I did something dopey in my code. -Drew -- Posted via http://www.ruby-forum.com/.