From: Joel VanderWerf Date: 2002-02-17T12:14:31+09:00 Subject: Re: Hi, this code... Jeff wrote: > > Hi, this code: > > text0 = "One $BLAH Three" > text1 = "One @BLAH Three" > text0.sub!("$BLAH", "Two") > text1.sub!("@BLAH", "Two") > print text0,"\n" > print text1,"\n" > > produces this output: > > One $BLAH Three > One Two Three > > Is the '$' meant to be special at runtime like this? Yes, because the first arg to sub! is always used as a regex, even if it's in quotes. "foo".sub ".", "g" # ==> "goo" I've tripped up on that more times than I like to say ... -- Joel VanderWerf California PATH, UC Berkeley mailto:vjoel@path.berkeley.edu Ph. (510) 231-9446 http://www.path.berkeley.edu FAX (510) 231-9512