Displaying 1 result from an estimated 1 matches for "field_must_break".
2007 Feb 16
13
negate the regexp in validates_format_of
...wbies might not know how to write a regexp that
excludes a match, instead of tests for it. Understand - I''m just
asking this question to help them. I have been using Regexps since
''grep'' on Xenix! But the newbies here might not know how to do this:
validates_format_of :field_must_break, :with => /\n/
validates_format_of :field_must_not_break, :with => /^[^\n]$/
The second one fails with data that correctly have no \n linefeed in them.
How do I - I mean "they" - negate a regexp?
--
Phlip
http://c2.com/cgi/wiki?ZeekLand <-- NOT a blog!!
--~--~-------...