From: Phrogz Date: 2007-02-15T02:05:06+09:00 Subject: Re: Puzzling regex behaviour On Feb 14, 8:51 am, Ian Macdonald wrote: > On Wed 14 Feb 2007 at 23:42:10 +0900, Ian Macdonald wrote: > > > On Wed 14 Feb 2007 at 18:00:22 +0900, Robert Klemme wrote: > > > > Another idea: maybe the readline lib interferes with encodings somehow > > > in IRB? What happens if you invoke your script from within IRB via "load"? > > > It runs as if run from the command line: > > > irb(main):001:0> load 'foo' > > 2 > > 2 > > I beg your pardon. I must have had the locale set incorrectly on that > run. It runs as if typed interactively into irb: > > $ irb > irb(main):001:0> load 'foo' > nil > 2 Phewsh. Combined with the behavior you reported for loading a global and then matching in IRB, I had feared the world had gone insane. At least its consistently weird and the regexp match is, in fact, the culprit.