Minimum 6 characters regex expression [closed]

2020-05-20 05:36发布

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

标签: regex
3条回答
我命由我不由天
2楼-- · 2020-05-20 06:22

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,}" />
查看更多
干净又极端
3楼-- · 2020-05-20 06:27

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

/[0-9a-zA-Z]{6,}/
查看更多
▲ chillily
4楼-- · 2020-05-20 06:31

This match 6 or more any chars but newline:

/^.{6,}$/
查看更多
登录 后发表回答