そういえば、次のように、-Ke で /^a\241/ というのを使うと、バッファ境界 を越えて読むようです。 % valgrind ruby -Ke -ve '/^a\241/' ==5761== Memcheck, a.k.a. Valgrind, a memory error detector for x86-linux. ==5761== Copyright (C) 2002, and GNU GPL'd, by Julian Seward. ==5761== Using valgrind-1.9.6, a program instrumentation system for x86-linux. ==5761== Copyright (C) 2000-2002, and GNU GPL'd, by Julian Seward. ==5761== Estimated CPU clock rate is 1201 MHz ==5761== For more details, rerun with: -v ==5761== ruby 1.8.1 (2003-12-24) [i686-linux] ==5761== Invalid read of size 1 ==5761== at 0x80A1DFD: ruby_re_compile_pattern (regex.c:2374) ==5761== by 0x809861C: make_regexp (re.c:559) ==5761== by 0x8099272: rb_reg_initialize (re.c:1083) ==5761== by 0x8099332: rb_reg_new (re.c:1116) ==5761== Address 0x41175BB7 is 0 bytes after a block of size 7 alloc'd ==5761== at 0x40168948: malloc (vg_clientfuncs.c:103) ==5761== by 0x806A75B: ruby_xmalloc (gc.c:116) ==5761== by 0x80AAE60: str_new (string.c:70) ==5761== by 0x80AAEA1: rb_str_new (string.c:83) -e:1: warning: useless use of a literal in void context ==5761== ==5761== ERROR SUMMARY: 1 errors from 1 contexts (suppressed: 0 from 0) ==5761== malloc/free: in use at exit: 336670 bytes in 7314 blocks. ==5761== malloc/free: 7578 allocs, 264 frees, 339655 bytes allocated. ==5761== For a detailed leak analysis, rerun with: --leak-check=yes ==5761== For counts of detected errors, rerun with: -v -- [田中 哲][たなか あきら][Tanaka Akira]