I'd throw it all into one big ugly regex:
s.match(/Query= 
(.+?\|.+?)\|.+?\(bits\)\s+Value\s+(.+?)\s+/m).to_a[1..2].join(' ')
=> "gi|23510597 At2g21510"

-- 
Posted via http://www.ruby-forum.com/.