On Sat, 2 Sep 2006 10:57:57 +0900
"Ben V." <comprug / gmail.com> wrote:

> I am trying to validate user input so it contains only letters, numbers, 
> underscores and dashes. I am using this regexp:/[A-Z0-9_-]/. However, 
> when I type in 'hello' in the field, it says that it doesn't match the 
> regexp, yet I'm sure that reg exp works for letters, numbers, and 
> underscores only. What am I doing wrong? Thanks for your help and time.
> 
> -- 
> Posted via http://www.ruby-forum.com/.
> 
> 

You need to validate lowercase also: /[A-Za-z0-9_-]/