From: Michel Demazure on 17 Jun 2010 09:34 Brian Candler wrote: > Michel Demazure wrote: >> BTW, Brian, do you have any idea about my post of two days ago (method >> lookup) ? > > You mean http://www.ruby-forum.com/topic/211458 ? Yes > No. I stay well clear of ruby 1.9.x. I switched sometime ago to 1.9 and my app now uses ordered hashes and enumerators. > So perhaps you could try one of the 1.9.2 previews. For the time being, it works with the strange ::Fixnum fix. I cross fingers and shall try 1.9.2 later on, when officially released. But 1.9.2 implies (or is it 1.9.x ?) - alas poor Yorick! - changing Regexp's : \d, \s,\w and the like work no more with utf-8 encodings! _md -- Posted via http://www.ruby-forum.com/.
From: Brian Candler on 17 Jun 2010 10:17 Michel Demazure wrote: > I switched sometime ago to 1.9 and my app now uses ordered hashes and > enumerators. Certainly there are cool new features in 1.9, and apparently improved speed. But these are outweighed for me by the total mess which is encodings. > But > 1.9.2 implies (or is it 1.9.x ?) - alas poor Yorick! - changing > Regexp's : \d, \s,\w and the like work no more with utf-8 encodings! Care to share an example, or point to a blog with more details? I have an older 1.9.2 lying around, it doesn't seem to behave how you describe. >> RUBY_DESCRIPTION => "ruby 1.9.2dev (2009-07-18 trunk 24186) [i686-linux]" >> a = "groß 123 über" => "groß 123 über" >> a.encoding => #<Encoding:UTF-8> >> a =~ /(\d+)/ => 5 >> $1 => "123" >> a =~ /(\w+)/ => 0 >> $1 => "groß" -- Posted via http://www.ruby-forum.com/.
From: botp on 17 Jun 2010 11:16 On Thu, Jun 17, 2010 at 10:17 PM, Brian Candler <b.candler(a)pobox.com> wrote: >>> RUBY_DESCRIPTION > => "ruby 1.9.2dev (2009-07-18 trunk 24186) [i686-linux]" >>> a = "groß 123 über" > => "groß 123 über" >>> a.encoding > => #<Encoding:UTF-8> >>> a =~ /(\d+)/ > => 5 >>> $1 > => "123" >>> a =~ /(\w+)/ > => 0 >>> $1 > => "groß" i think you caught the last one, > RUBY_DESCRIPTION => "ruby 1.9.2dev (2010-05-31 revision 28117) [i686-linux]" > a = "groß 123 über" => "groß 123 über" > a.encoding => #<Encoding:UTF-8> > a =~ /(\w+)/ => 0 > $1 => "gro" > $' => "ß 123 über" kind regards -botp
From: Michel Demazure on 17 Jun 2010 11:38 Brian Candler wrote: > Michel Demazure wrote: >> I switched sometime ago to 1.9 and my app now uses ordered hashes and >> enumerators. > > Certainly there are cool new features in 1.9, and apparently improved > speed. But these are outweighed for me by the total mess which is > encodings. > >> But >> 1.9.2 implies (or is it 1.9.x ?) - alas poor Yorick! - changing >> Regexp's : \d, \s,\w and the like work no more with utf-8 encodings! > > Care to share an example, or point to a blog with more details? It was written in a post in this forum (or ruby core) I think from Yusuke Endoh about the coming 1.9.2 release. You have to replace \d by \p{Digit}, and similarly for \s, and the like... Sad perspective. Look at the beautiful example ! RangeReg = /\A(\p{Digit}+|\p{Digit}+\.\.\p{Digit}+)(,\p{Space}*(\p{Digit}+|\p{Digit}+\.\.\p{Digit}+))*\Z/ -- Posted via http://www.ruby-forum.com/.
From: Michel Demazure on 17 Jun 2010 11:47 Michel Demazure wrote: > > Look at the beautiful example ! > > RangeReg = > /\A(\p{Digit}+|\p{Digit}+\.\.\p{Digit}+)(,\p{Space}*(\p{Digit}+|\p{Digit}+\.\.\p{Digit}+))*\Z/ I think I'll add a Regexp#one_nine_two_escape method! _md -- Posted via http://www.ruby-forum.com/.
First
|
Prev
|
Next
|
Last
Pages: 1 2 3 Prev: WIN332Ole , pass by reference Next: [ANN] unicorn 1.0.0 - yes, this is a real project |