On Tue, Feb 12, 2013 at 5:03 PM, Horv=E1th Alex <lists / ruby-forum.com> wrot=
e:
> Hey guys,
>
> I'm about the extend my watir testcases with dict error checking for our
> tests. I managed to make the check, but I'd like to select the whole
> word and store it in a variable or to write in a txt file.
>
> So in practice, I'd like my scripts to
> if "???" (dict errors in our system are in the following format
> ???x.Y???) is found on the current page than select the whole word and
> write in a txt file. Also it would be nice to store all of these dict
> errors (in case there are several on the page)
>
> Here is what i've got so far
>
> ##################### Dict error check
> ###########################################################
> if ie.text.include? "??"
> puts "!!!!!!!!!!!"
> puts "DICTERROR"
> puts "!!!!!!!!!!!"
> input =3D gets
> else
> end

text =3D "something ???aaa.bbbb??? and something else"
m =3D text.match(/(\?\?\?[^.]*\.[^?]*)\?\?\?/)
if m
  m.captures.first
end

 =3D> "??aaa.bbbb??"

This is checking that it has a dot in the middle, you might simplify
the regex if you don't need that.

Jesus.