Ruby 2.0 "invalid multibyte escape" in Regexp

This line of code used to work in Ruby 1.9.3, but it fails in Ruby 2.0:

@data[:VR] = line[1].strip.gsub( /\xB6|\xFF/, '' )

The error I get is:

Test.rb:75: invalid multibyte escape: /\xB6|\xFF/ (SyntaxError)
invalid multibyte escape: /\xB6|\xFF/
invalid multibyte escape: /[\xB6\xFF@"'].+/

I assume I'm supposed to be changing some encoding somewhere, or perhaps
using "\u0080" or something like that, but I'm a bit stumped at the
moment. Any ideas?

···

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

I think I've found a workaround, but it's not pretty, and I'm not sure
whether the matching will work properly:

@data[:VR] = line[1].strip.force_encoding("ASCII-8BIT").gsub( /#{
"\xB6|\xFF".force_encoding("ASCII-8BIT") }/, '' )

···

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