validation expression

  • Thread starter Thread starter Andy G
  • Start date Start date
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
 
1. "^[^-]*$"
2. "(.*)@visionx(.*)" - although I'd suggest you also check out the
regexes at regexlib.com.
 
Back
Top