I am trying to validate user input in a php script. I want the var to be only lower case letters with a minimum length of four characters. I tried the following:
preg_match('/^[a-z]{4}+$/', $my_var)
But this only matches if the string is exactly 4 characters in length. How can you say at least 4 with no maximum?
preg_match('/^[a-z]{4,}+$/', $my_var)
{4,}
will match strings of length 4 or more.