i am using asp.net 3.5 and VB.net, i need a validation expression to validate a string of 1 to 50 characters, white spaces, numbers, special character are all allowed, simply, it should match an nvarchar(50) database field. it will be applied to a textbox, also, the same case but for 1-200 characters which will be validating a multi-line textbox..
Thanks in advance
Do you mean that it just needs to ensure that there are between 1 and 50/200 characters in the strings?
If so, try these:
Testing for
[\s\S]rather than[.]ensures that any newlines in the multiline textarea don’t cause problems.