Minimum 6 Characters Regex Expression [Closed]

Minimum 6 Characters Regex Expression [Closed]

I m looking for regex which checks for at least 6 characters, regardless of which type of character.

4

3 Answers

This match 6 or more any chars but newline:

/^.{6,}$/
2

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

/[0-9a-zA-Z]{6,}/
2

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,}" />
1
Alexander Ross
Author

Alexander Ross

Alexander Ross has covered the video game industry for a decade, writing deep dives on game design, esports tournaments, VR developments, and gaming culture.