Watir and regexp

We want to test a value given in a text field with a regular
expression. We are trying to do it this way:


This is not working for us. We also tried using

None of these work.

[email protected] wrote:

None of these work.
Define “work”. Have you take the step of creating a test regex that must
succeed, in order to eliminate syntax errors other than regex ones?


I can’t help you with any Watir syntax issues that may be present, but
regex would be better written as:


This assures that nine consecutive digits are all that is present in the
field. Your original regex only assured that nine consecutive digits
present somewhere in a field that could contain an arbitrary amount of
other data.