php - Can some help: 'No ending delimiter' -
this question has answer here:
message! 'warning preg_match(): no ending delimiter '^' found in e:\wamp\form_elements...
if(!preg_match("^[_a-z0-9-]+(\.[_a-z0-9-]+)*@[a-z0-9-]+(\.[a-z0-9-]+)*(\.[a-z]{2,3})$", $email)) { echo "invalid email form please reenter<br />";}
any suggestions. mean if wasn't new maybe figure out, xq's laziness.
thank in advanced.
your pattern needs have starting , ending delimiter (in case i've used ~
), see preg_match
:
preg_match("~^[_a-z0-9-]+(\.[_a-z0-9-]+)*@[a-z0-9-]+(\.[a-z0-9-]+)*(\.[a-z]{2,3})$~", $email);
the delimiter used mark beginning & ending of pattern. after ending delimiter can add modifiers such case insensitive (i
):
$pattern = '~^[a-z]{3,6}$~i';
Comments
Post a Comment