c# Regex question: only letters, numbers and a dot (2 to 20 chars) allowed

Posted by Michel on Stack Overflow See other posts from Stack Overflow or by Michel
Published on 2010-05-17T14:46:40Z Indexed on 2010/05/17 14:50 UTC
Read the original article Hit count: 182

Filed under:
|

Hi,

i am wrestling with my regex. I want to allow only letters and numbers and a dot in a username, and 2 to 20 chars long I thought of something like this

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

but then 21 chars is also ok, and that's not what i want

© Stack Overflow or respective owner

Related posts about c#

Related posts about regex