How do I search for a string that contains only chars from a set including x, and require it to contain x? e.g. [a-z]+ but not matching if it doesn’t contain x.
So it should match quux but not foo or bar.
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.
Assuming you want to match a string of only x,y or z, match start (
^) followed by zero or moreyorz([yz]*) followed by anxfollowed by zero or morex,yorz([xyz]*) followed by end ($)If you are trying to match
[a-z]but with anxin there somewhere, then this should do it