Jon wrote: > B=" <orderMsg type=7 size=0>" > ... > /<(\w+?)(?:\s(\w+)=(\w+))+>/ > ... > md[0]=<orderMsg type=7 size=0> > md[1]=orderMsg > md[2]=size > md[3]=0 It is correct. "(?:\s(\w+)=(\w+))+" matches two times, the last match is with "size" and "0". The groups will be overwritten each time the "+" will repeat the group. Wolfgang NĂ¡dasi-Donner -- Posted via http://www.ruby-forum.com/.