From: Brian Candler Date: 2010-02-25T07:55:31+09:00 Subject: Re: How do I set the encoding on a regexp ? Perry Smith wrote: > But the "fixed encoding" is a key part of the puzzle I was missing. > Also, David, I had not bumped into the ENC_UTF8 constant yet. There are > quite a few constants (like the 16 pointed out by David also) is a flag > to make the encoding "fixed". 16 is just Regexp::FIXEDENCODING irb(main):001:0> Regexp::FIXEDENCODING => 16 In the 1.9.2 I have here (r24186, 2009-07-18) there is no Regexp::ENC_UTF8, so it must be relatively new. irb(main):002:0> Regexp::ENC_UTF8 NameError: uninitialized constant Regexp::ENC_UTF8 from (irb):2 from /usr/local/bin/irb192:12:in `
' irb(main):003:0> Regexp.constants => [:IGNORECASE, :EXTENDED, :MULTILINE, :FIXEDENCODING] As for the third arg to Regexp.new, I have no idea. Documentation is not Ruby's strong point at the best of times, but it's nonexistent for the encoding stuff. -- Posted via http://www.ruby-forum.com/.