ASP.NET RegEx For TextArea Max Length and CRLF Concerns
I'm looking to validate the length of a textarea using a regular expression validator. It should allow all characters and 开发者_C百科crlfs. I'm also concerned about crlfs counting as 1 or 2 characters, I'm concerned it may be different across browsers but I'm hoping ASP.NET regulates it. Also, I'm saving to a mix of varchar and nvarchar fields in MSSQL, do I need to be concerned about the way crlfs are saved there? I'm in a hurry to do this right, so I'll be researching all this on my own but I'm just hoping someone out there might have experience handling such concerns.
The following expression allows 0 to 1000 chars:
[\w\n\r]{0,1000}
精彩评论