From: Shri Borde Date: 2009-02-06T02:56:40+09:00 Subject: [ruby-core:21863] Bug with [:lower:] --_000_710DF26F214D2B4BB94287123FFE980A2DD9EE58C1NAEXMSGC104re_ Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: quoted-printable [:upper:] works as expected. [:lower:] matches incorrectly to an empty posi= tion at the start of the string. It's the same with both 1.8.6 and 1.9. irb(main):031:0> /[[:lower:]]*/.match("Aa1").to_a =3D> [""] irb(main):032:0> /[[:lower:]]*/ =3D~ "Aa1" =3D> 0 irb(main):033:0> /[[:upper:]]*/.match("Aa1").to_a =3D> ["A"] irb(main):034:0> /[[:upper:]]*/ =3D~ "Aa1" =3D> 0 Thanks, Shri --_000_710DF26F214D2B4BB94287123FFE980A2DD9EE58C1NAEXMSGC104re_ Content-Type: text/html; charset="us-ascii" Content-Transfer-Encoding: quoted-printable

[:upper:] works as expected. [:lower:] matches incorre= ctly to an empty position at the start of the string. It’s the same with b= oth 1.8.6 and 1.9.

 

irb(main):03= 1:0> /[[:lower:]]*/.match("Aa1").to_a

=3D> [&qu= ot;"]

irb(main):03= 2:0> /[[:lower:]]*/ =3D~ "Aa1"

=3D> 0

irb(main):03= 3:0> /[[:upper:]]*/.match("Aa1").to_a

=3D> ["A"]

irb(main):03= 4:0> /[[:upper:]]*/ =3D~ "Aa1"

=3D> 0

 

Thanks,

Shri

 

--_000_710DF26F214D2B4BB94287123FFE980A2DD9EE58C1NAEXMSGC104re_--