You've gotten a lot of good suggestions here, but I figured I'd toss in my own. Instead of scanning, you can use the "[]" operator on a string, and "," to pull out the saved portion of the regex. "i like APPLES AND Bananas"[/[A-Z]+/] =>"APPLES" #now lets make it bigger "i like APPLES AND Bananas"[/[A-Z ]+ [A-Z][a-z]/] => " APPLES AND Ba" #Too much stuff so just select what we want.. using () #AND, use ,1 to just get the saved portion of the match "i like APPLES AND Bananas"[/([A-Z ]+) [A-Z][a-z]/,1] => " APPLES AND" #Now applying this to your situation... regex=/EMISOR: ([A-Z ]+) [A-Z][a-z]/ #this is assuming there are no \n \r or \t chars in the middle, easy enough to fix if there are line="REGISTRO DE LA PROPIEDAD DE ALBACETE X EMISOR: MANUELA ADORACION CEBOLLA GARCIA Padre Romano, 12 2005 ALBACETE ALBACETE NIF: 44444444P " line[regex,1] => "MANUELA ADORACION CEBOLLA GARCIA" --Kyle