I want to build pattern for preg_match that will match any string with length 1 – 40 chars. I found this:
^[^<\x09]{1,40}\Z
But with that one I recieve this error message:
function.preg-match]: Unknown modifier '<' in ....
Any suggestion ?
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.
/^.{1,40}$/should match any string that’s 1 to 40 characters long.What it does is that it takes the
., which matches everything, and repeats it 1 to 40 times ({1,40}). The^and$are anchors at the beginning and end of the string.