Question: What is a regular expression to allow letters only, with no spaces or numbers, with a length of 20 characters?

Some examples of acceptable usernames:

```
ask1kew
supacool
sec1entertainment
ThatPerson1
Alexking

```

Some examples of unacceptable usernames:

```
No_problem1
a_a_sidkd
Thenamethatismorethen20characterslong

```

Answer: 
This should work if you're limiting yourself to ASCII:

```none
/\A[a-z0-9]{,20}\z/i

```

That will also match an empty string though so you might want to add a lower limit (5 in this example):

```none
/\A[a-z0-9]{5,20}\z/i

```

If you wanted to be adventurous and allow non-ASCII letters and you're using Ruby 1.9 then you could use this:

```none
/\A\p{Alnum}{5,20}\z/
/\A\p{Alnum}{,20}\z/   # If no lower limit on length is desired.

```
`^[a-zA-Z0-9]{1,20}$`

`{1,20}` is `{min, max}` so you could set it to `{5,20}` to limit it to minimum of 5 chars and a max of 20.