Blog Thread
- PHP regex: ^ and $ vs \A and \z
Please fill in the below form to get in contact with me. Subject and message fields are required.
$name = "joe";
if (preg_match('/^[a-zA-Z]+$/', $name) {
}
if (preg_match('/\A[a-zA-Z]+\z/', $name) {
}
$name = "joe¥n";
if (preg_match('/^[a-zA-Z]+$/', $name) {
echo "match!";
}