On Wednesday 23 March 2005 04:04 am, Robert Klemme wrote: > The internal buffer (the characters) is shared but there is a new Ruby > > instance each time you invoke String#[]: > >> 10.times { puts s1[2,4].id } > > 134979736 > 134979676 > 134979652 > 134979592 > 134979496 > 134979472 > 134979436 > 134979364 > 134979268 > 134979196 > => 10 Oh, yeah, thanks--I could/should have tried that. ;-) Aside: but: irb(main):005:0> 10.times { puts s1[2].id } 211 211 211 211 211 211 211 211 211 211 => 10 irb(main):006:0> Which (maybe) looks nicer/more reasonable, except I don't know why the 3 digit ID in this case. > > bash-2.05b$ re_test6a.rb > > /re_test6a.rb:40: Invalid char `\240' in expression > > /re_test6a.rb:41: Invalid char `\240' in expression > > .. > > /re_test6a.rb:66: Invalid char `\240' in expression > > bash-2.05b$ > I guess this and the other syntax error above are caused by copying and > pasting some characters outside the ASCII range. I have experienced > similar errors in the past. Sometimes they look like whitespace > characters so you don't recognize them on first sight. That was apparently the problem--I removed all the whitespace within the loop, then replaced each with a space, and now it runs. I'll upload the revised program to TWiki later today (not getting through at the moment). http://twiki.org/cgi-bin/view/Wikilearn/RWP_RE_Tests > Please let me/us know how that works out. Sure, although things may slow down for a while with 3 Ruby library books in my hands and until tax season is over. regards, Randy Kramer