thanks. I found a better way :


s = " sss\1\2abcd\xAA sss "
s.force_encoding('ASCII-8BIT')

p s.scan(Regexp.new '\001[\002\004](.*?)\xAA', nil , 'n')[0]

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