From: Paul Lutus Date: 2006-09-02T11:40:26+09:00 Subject: Re: RegExp issues.... Ben V. 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. You are not accepting lowercase characters. For convenience, try this: /\w-/ The special token \w translates into "A-Za-z0-9_", IOW uppercase and lowercase letters, numbers, and underscore, leaving only the dash to be included explicitly. -- Paul Lutus http://www.arachnoid.com