unknown wrote:
> HI
> For ex i want to check for pattern  variable in watir - Ruby and search
> like following
> 
> 
> pattern= 'oo'
> ie.button(:value, /pattern/i).click
> 
> How do i do it.
> 
> Seede


use #{variable_name} inside the regexp

vis:
irb(main):018:0> fred = "bob"
=> "bob"
irb(main):019:0> " my name is fred flintsone" =~ /#{fred}/
=> nil
irb(main):020:0> "my name is bob bowden" =~ /#{fred}/
=> 11


best,
jp

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