Validate that input doesn't contain default text?

I know I have written this before, but now I cannot find it. I want to
make sure that my input doesn’t contain ‘Other…’. I know there’s
some lookbehind regex that can get that, but I have had nothing but
errors when I try to use it in a validates_format_of block. Any
suggestions?

Thanks,

Walter

And I’m using Ruby 1.8.7, which does not include lookbehind regex,
come to find.

Walter

Walter D. wrote in post #950212:

I know I have written this before, but now I cannot find it. I want to
make sure that my input doesn’t contain ‘Other…’. I know there’s
some lookbehind regex that can get that, but I have had nothing but
errors when I try to use it in a validates_format_of block. Any
suggestions?

Thanks,

Walter

Write your own validation method that tests that the string doesn’t
match /Other.../.

Best,

Marnen Laibow-Koser
http://www.marnen.org
[email protected]

This forum is not affiliated to the Ruby language, Ruby on Rails framework, nor any Ruby applications discussed here.

| Privacy Policy | Terms of Service | Remote Ruby Jobs