Can anyone please tell me regular expression so that only ‘a’,’A’,’p’ and ‘P’ can be entered as input and at a time only one of those character should be entered?
Thanks in advance.
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
Here’s a simple one:
[aApP]Does that work for you?
You might have to add language-specific start & end line symbols, e.g.
^[aApP]$if you want to check that the entire input consists only of that one character.