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 characters are: ( ) [ ] * . - ^ $
>
> There are more and depending on where they occur in your search string
> they may cause more or less or no damage.
$ie.div(:text, Regexp.escape(myvar))
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups
"Watir General" group.
To post to this group, send email to [email protected]
Before posting, please read the following guidelines:
http://wiki.openqa.org/display/WTR/Support
To unsubscribe from this group, send email to
[email protected]
For more options, visit this group at
http://groups.google.com/group/watir-general
-~----------~----~----~----~------~----~------~--~---