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/.