validation expression

A

Andy G

I need some quick help on regular expressions.

1. I have a text box that the user CANNOT enter a hyphen. How can I check
this textbox using a regular expression to tell the user they cannot enter a
hyphen.

2. I have another text box that the user needs to enter an email address
that contains '@visionx' somewhere in the address.

Thanks for the help, or please direct me to the right location.

Andy
 
W

Wilco Bauwer

1. "^[^-]*$"
2. "(.*)@visionx(.*)" - although I'd suggest you also check out the
regexes at regexlib.com.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
474,431
Messages
2,571,677
Members
48,796
Latest member
Greg L.

Latest Threads

Top