0

I am new to Reg Expressions. How can I check if a textbox can only hold 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.

3 Answers 3

4

Your first example:

/[YyNn]/

Your other example:

/(abc|cba)/

I recommend reading about regular expressions here: http://perldoc.perl.org/perlretut.html

Sign up to request clarification or add additional context in comments.

Comments

1

Y|y|N|n for Textbox 1 (abc)|(cba) for Textbox 2

Comments

1

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 ;).

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.