PHP正規表現preg_match
dechex

preg_match正規表現

preg_match_all

正規表現で最初のマッチを検索します。

構文

preg_match(string $pattern, string $subject, array &$matches = null): int|false

使用例

下記の値を入力するとサンプルに即時反映されます。

email
if
preg_match
echo
$email = "user@example.com";
if (preg_match('/^[a-z0-9.]+@[a-z0-9.]+.[a-z]{2,}$/', $email)) {
    echo "유효한 이메일";
}