On 2/14/07, David Balmain <dbalmain.ml / gmail.com> wrote: > On 2/14/07, Ian Macdonald <ian / caliban.org> wrote: > > However, I'm still puzzled why there's a difference between irb and a > > stand-alone script. > > Maybe your editor saves the script in UTF-8 format. The irb example > clearly encodes the string in ISO-8859-1. That could explain the > difference. For example; ~$ echo $LANG en_US.ISO-8859-1 ~$ irb -f irb(main):001:0> "pr\351f\351r\351es" =~ /[^[:alnum:]]/ => nil irb(main):002:0> "pr\303\251f\303\251r\303\251es" =~ /[^[:alnum:]]/ => 3 Not exactly what you had but it probably has something to do with the encoding of the é® -- Dave Balmain http://www.davebalmain.com/