If there are no lowercase letters in a string using PHP "preg_match", "No lowercase letters!" I want to print the warning.
Normally, there is no letter " İ " among the allowed characters. But the warning I want is not displayed.
Desired Result:
I want a warning displayed when there are different characters, except for those allowed.
Allowable lowercase letter list;
[a-z]
a b c d e f g h i j k l m n o p q r s t u v w x y z
Extra Small Letters
ığüşöç
My Faulty Code:
<?php
$string = "THIS İS A TEST";
if (!preg_match("/[a-zığüşöç]/",$string)){
echo 'No lowercase letters!';
}
// Result: empty
?>
Reply
if (!preg_match("/[a-zığüşöç]+$/",$string)){
echo 'No lowercase letters!';
}