tags:

views:

108

answers:

3

Minumum 6 letter checks textbox in asp.net.

I m looking for all letters and numbers, but I need it for all characters.

+2  A: 

If I understand correctly, you need a regex statement that checks for at least 6 characters (letters & numbers)?

/[0-9a-zA-Z]{6,}/
xil3
yes but it can be special characthers etc.. all types but 6 letters filter.
Jack
Any special character?
xil3
If you want any, you can just do this (not advisable though):/.{6,}/
xil3
+2  A: 

Something along the lines of this?

<asp:TextBox id="txtUsername" runat="server" />

<asp:RegularExpressionValidator
id="RegularExpressionValidator1"
runat="server"
ErrorMessage="Field not valid!"
ControlToValidate="txtUsername"
ValidationExpression="[0-9a-zA-Z]{6,}" />
earino
+5  A: 

This match 6 or more any chars but newline :

/^.{6,}$/
M42