Subject: | Length validation regular expressions and multi-line values |
I'm using Data::FormValidator to validate some input from a textarea in
a web form.
I'm performing a basic length check on the input, just to make sure I
can feedback something useful if the content is too big for my database
column using Data::FormValidator::Constraints::FV_max_length
It works fine - until I put a carriage return into the text area, at
which point it fails to validate.
I'm running a modified version which adds the s modifier to the regular
expressions so the input is treated as a single line and the line breaks
ignored:
For FV_max_length: m/^(.{0,$max}$)/s
I could knock up a patch and test for the module but I thought I'd check
there wasn't a reason for it being like this...
Carl