I am new to Reg Expressions. How can I check if a textbox can only h开发者_Go百科old Y,y,N,n values, Textbox 2 can only have string "abc" or "cba" What will be the ValidationExpression? I will really appreciate help. Thank you in advance.
Your first example:
/[YyNn]/
Your other example:
/(abc|cba)/
I recommend reading about regular expressions here: http://perldoc.perl.org/perlretut.html
Y|y|N|n
for Textbox 1
(abc)|(cba)
for Textbox 2
If you are new to regular expressions, may I recommend this? http://code.google.com/p/kiki-re/
It's a regular expressions tester, you write your regex and some text to text it. It's really nice to learn about regexes and to test them too ;).
精彩评论