[Wtr-general] Regex string comparison
Paul Carvalho
tester.paul at gmail.com
Tue Aug 15 11:05:24 EDT 2006
Hi there, I'm still a novice when it comes to using regular expressions and
am having a bit of difficulty figuring out the syntax on the following
problem.
Here's what I want to do:
- I'm trying to create a branch in the code if the PageHeadingLabel contains
one of two words.
Here's the line that I've tried:
if t_ie.span(:id, /PageHeadingLabel/).text.include?( /Create|Update/ )
This doesn't work. When I try it in IRB, I see the following message:
---
TypeError: can't convert Regexp into String
from (irb):7:in `include?'
from (irb):7
from :0
---
Suggestions? I really didn't want to use two comparisons, one for each
word. There must be an efficient way to do this, yes?
Paul.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://rubyforge.org/pipermail/wtr-general/attachments/20060815/24b348c9/attachment.html
More information about the Wtr-general
mailing list