Regular Expression Validator Length

Posted on: Tue Jul 21 12:30:42 -0700 2009. Updated on: Tue Jul 21 12:32:01 -0700 2009.
Category: DotNet

It is pretty easy to check the length of a textbox using a regular expression validator. Simply set the ValidationExpression="[\s\S]{6,15}" and that's it. Note the 6,15 mean min,max, ie. 6 chars min and 15 chars max.
This can be useful for Password Validation and similar.

Must be btw 6 and 15 characters

Comments:

Add a Comment:

simple_captcha.jpg
(human authentication)


Ads

Categories

About

Random foliage

This website is meant to be a reference for ASP Dot Net developers. The entries are a compilation of things I've figured out how to do and that I deem useful to keep of track for future reference. Assumptions: web development with: C Sharp (vb sucks), visual studio 05/08, .net 3.5, meant for programmers. Written by: James Reategui.