Regex supports #{variable}.

irb(main):016:0> name = "Ram Roy"
=> "Ram Roy"
irb(main):017:0> a.match(/value="(\d+)".+#{name}/)[1]
=> "6360899"

-- 
Posted via http://www.ruby-forum.com/.