php - Can some help: 'No ending delimiter' -


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

Popular posts from this blog

commonjs - How to write a typescript definition file for a node module that exports a function? -

openid - Okta: Failed to get authorization code through API call -

ios - Change Storyboard View using Seague -