# Interpolation question

**URL:** <https://www.ruby-forum.com/t/interpolation-question/184271>\
**Category:** Ruby\
**Created:** [February 27, 2010, 7:59pm UTC](https://www.ruby-forum.com/t/interpolation-question/184271 "2010-02-27T19:59:49Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![Dudebot](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/d/e495f1/32.png) [@Dudebot](https://www.ruby-forum.com/u/Dudebot)\
**Post date:** [February 27, 2010, 7:59pm UTC](https://www.ruby-forum.com/t/interpolation-question/184271/1 "2010-02-27T19:59:49Z")

</div>

Why does

text = \<\<ENDTEXT  
this is an wibble  
of stuff bobble  
ENDTEXT

wibble = 2.0  
bobble = 3.0

newtext = text.gsub( /(.\*?)\</field\>/, “#{\1}” )

puts newtext

throw this error:  
./test.rb:13: syntax error, unexpected $undefined  
newtext = text.gsub( /(.\*?)\</field\>/, “#{\1}” )

and not interpolate to produce  
this is an 2.0  
of stuff 3.0

?

And how can I do that interpolation? (adding \s to \1, e.g. \1  
doesn’t help)

Many TIA,  
Craig
