Andy Sipe wrote:
> You can also use interpolation to do it shorter:
>
> myvar =
> puts $ie.div(:text, /#{myvar}/)
>
> In either case, any regex reserved character will either have to be
> stripped or escaped to avoid out right errors like with the ( or weird
> matches.
>
> Some of those cha
Thanks,
Very helpful.
DD
From: watir-general@googlegroups.com
[mailto:watir-gene...@googlegroups.com] On Behalf Of Andy Sipe
Sent: Wednesday, January 21, 2009 12:07 PM
To: watir-general@googlegroups.com
Subject: [wtr-general] Re: How can I use a
You can also use interpolation to do it shorter:
myvar =
puts $ie.div(:text, /#{myvar}/)
In either case, any regex reserved character will either have to be stripped
or escaped to avoid out right errors like with the ( or weird matches.
Some of those characters are:( ) [ ] * . - ^ $
Th
I got it.
if message.index("*") != nil
myvar = message[0,message.index("*")].to_s
regxmyvar = Regexp.new myvar
puts $ie.div(:text,regxmyvar)
end
It failed if If my string end with '(' so I'm guessing special
characters have to be substituted.
On Jan 21, 11:37 am, Moochie wrote: