I need a regular expression to match up to a couple criteria.
the string needs to be 8 characters long, and can only have the following letters in it: urdl.
I think it’d be something similar to /(.{8}('u')('r')('d')('l'))/
Can you help me out?
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.
In C# you can use “^[urdl]{8}$”, which ensures that the length is exactly 8 characters (and no more and no less). The “^” means the beginning, “$” represents the end, and there are 8 characters – “{8}” which each match one of the letters in the set “[urdl]”.