From: dblack@... Date: 2003-05-21T20:17:10+09:00 Subject: Re: How do I get a variable into a gsub? Hi -- On Wed, 21 May 2003, Dave Oshel wrote: > B = "x" # the current thing I want to match and replace > > Then: > > A.gsub( Regexp.compile(B), " (#{B}) " ) ==> error! > > And so on... > > How do I get a variable into that seemingly constant regular expression > field? The first step would be to use variables. Right now you're using constants :-) But either way, I can't duplicate your error. Can you show some runtime output? David -- David Alan Black home: dblack@superlink.net work: blackdav@shu.edu Web: http://pirate.shu.edu/~blackdav