Search
 
SCRIPT & CODE EXAMPLE
 

PHP

regex for email php

<?php

$pattern = '/^(?!(?:(?:x22?x5C[x00-x7E]x22?)|(?:x22?[^x5Cx22]x22?)){255,})(?!(?:(?:x22?x5C[x00-x7E]x22?)|(?:x22?[^x5Cx22]x22?)){65,}@)(?:(?:[x21x23-x27x2Ax2Bx2Dx2F-x39x3Dx3Fx5E-x7E]+)|(?:x22(?:[x01-x08x0Bx0Cx0E-x1Fx21x23-x5Bx5D-x7F]|(?:x5C[x00-x7F]))*x22))(?:.(?:(?:[x21x23-x27x2Ax2Bx2Dx2F-x39x3Dx3Fx5E-x7E]+)|(?:x22(?:[x01-x08x0Bx0Cx0E-x1Fx21x23-x5Bx5D-x7F]|(?:x5C[x00-x7F]))*x22)))*@(?:(?:(?!.*[^.]{64,})(?:(?:(?:xn--)?[a-z0-9]+(?:-+[a-z0-9]+)*.){1,126}){1,}(?:(?:[a-z][a-z0-9]*)|(?:(?:xn--)[a-z0-9]+))(?:-+[a-z0-9]+)*)|(?:[(?:(?:IPv6:(?:(?:[a-f0-9]{1,4}(?::[a-f0-9]{1,4}){7})|(?:(?!(?:.*[a-f0-9][:]]){7,})(?:[a-f0-9]{1,4}(?::[a-f0-9]{1,4}){0,5})?::(?:[a-f0-9]{1,4}(?::[a-f0-9]{1,4}){0,5})?)))|(?:(?:IPv6:(?:(?:[a-f0-9]{1,4}(?::[a-f0-9]{1,4}){5}:)|(?:(?!(?:.*[a-f0-9]:){5,})(?:[a-f0-9]{1,4}(?::[a-f0-9]{1,4}){0,3})?::(?:[a-f0-9]{1,4}(?::[a-f0-9]{1,4}){0,3}:)?)))?(?:(?:25[0-5])|(?:2[0-4][0-9])|(?:1[0-9]{2})|(?:[1-9]?[0-9]))(?:.(?:(?:25[0-5])|(?:2[0-4][0-9])|(?:1[0-9]{2})|(?:[1-9]?[0-9]))){3}))]))$/iD';

$emailaddress = 'test@gmail.com';

if (preg_match($pattern, $emailaddress) === 1) {
    // emailaddress is valid
}
Comment

PREVIOUS NEXT
Code Example
Php :: php time format 
Php :: Check duplicate email in laravel using jQuery validation 
Php :: laravel middleware route group 
Php :: display exception in blade laravel 
Php :: php grab month from date 
Php :: how to add property to the request object 
Php :: TreeBuilder::getRootNode()" before creating the root node is not supported, migrate to the new constructor signature instead. 
Php :: remove gutenberg styles 
Php :: insert rows in migrations laravel 
Php :: smarty shorthand assign var 
Php :: include php 
Php :: php retour à la ligne 
Php :: wordpress get current category slug 
Php :: php format datetime 
Php :: wordpress my account url 
Php :: string to bool php 
Php :: PHP auto refresh page 
Php :: custom bootstrap pagination laravel 
Php :: how to fetch particular css file in wordpress 
Php :: laravel gigapay update employee 
Php :: create guid in php 
Php :: php sleep 1 second 
Php :: zend redirect to url 
Php :: preg_match number only in php 
Php :: how handle the number with k in laravel balde 
Php :: how to hide get parameters in url php 
Php :: strtoupper php 
Php :: php run python script 
Php :: please provide a valid cache path. laravel 
Php :: laravel checkbox terms and conditions 
ADD CONTENT
Topic
Content
Source link
Name
5+8 =