asp.net regular expression not working as expected

Posted by Zaps on Stack Overflow See other posts from Stack Overflow or by Zaps
Published on 2010-03-16T11:48:30Z Indexed on 2010/03/16 11:56 UTC
Read the original article Hit count: 143

Filed under:
|
|

Hi,

I have a textbox and a regular expression validator applied to it. I want to make sure that the only allowed string inputted into the textbox are "Anything Entered" or "Something Else" or "Another String" otherwise I want an error to be displayed.

This is the regular expression I have so far:

ValidationExpression="(^Anything Entered)$|(^Something Else)$ |(^Another String)$"

However when I enter the supposed valid strings the error is displayed. I cant figure out whats wrong with the expression. Any help would be greatly appreciated.

Thanks,

Zaps

© Stack Overflow or respective owner

Related posts about ASP.NET

Related posts about regex