From: Kassym Dorsel Date: 2011-10-08T04:15:41+09:00 Subject: Re: regex an array? This is probably not the best way of doing this but here goes : /(\S*[^"\]]){4}/ Will match 'TI-0001'. If using on different strings that are not alike it probably won't work. Look at http://www.rubular.com/ for regex in ruby. Great tool! -- Posted via http://www.ruby-forum.com/.