I need to validate the length of input of a textbox.
The max length property does not work for Multiline textboxes.
The regular expression I have is:
Change .{0,500} to [\s\S]{0,500}. Note that carriage returns won't exactly be ignored; they'll still count toward the 500-character limit.
.{0,500}
[\s\S]{0,500}
Of course, if 500 characters is the size of your database field, that's exactly the behavior you want.