これでPHPでpreg_match()
を使用しようとしています。文字と空白をフィルタリングしたいだけです。しかし、私はフィルタリングの部分を理解していない。 これは私が持っているものです。だから、現在は間違っていますが、スペースと大文字をどうすればいいですか?誰かがpreg_matchをフィルタリングする方法を説明できますか?
$usertest = "username is Cheese";
if (preg_match("/[a-z]/", $usertest)) {
echo 'TRUE';
} else {
echo 'FALSE';
}
http://php.net/manual/en/function.preg-match.php - https://www.tutorialspoint.com/php/php_regular_expression.htm –
いつでもhttps:// regex101あなたが正規表現を書く場合.comまた、右下のクイックリファレンスもご覧ください。 – Rizier123