Return to Snippet

Revision: 30530
at November 22, 2010 17:17 by alexandrepayet


Updated Code
<?php

$EXP_num = "^[0-9]+$";
$EXP_num_fixe = "^0262([0-9]){6}$";
$EXP_num_portable = "^069(2|3)([0-9]){6}$";
$EXP_cp = "^974([0-9]){2}$";
$EXP_mail = "^([a-z0-9._-])+@([a-z0-9.-])+(.)([a-z]){2,4}$";
$EXP_nom = "^[a-zA-ZéçèàêëîïôöûüâäÉÀÈËËÏÎÖÔÛÜÄÂ'-][a-zA-ZéçèàêëîïôöûüâäÉÀÈËËÏÎÖÔÛÜÄÂ' -]{2,50}$";
$EXP_date = "^[0-9]{2}/[0-9]{2}/[0-9]{4}$";
$EXP_url = "^http://";
$EXP_alphanum = "^[a-zA-Z0-9_-]$";

if(!ereg($EXP_mail, $mail)){ echo "your mail is invalid"; }

?>

Revision: 30529
at November 22, 2010 17:16 by alexandrepayet


Updated Code
<?php

$EXP_num = "^[0-9]+$";
$EXP_num_fixe = "^0262([0-9]){6}$";
$EXP_num_portable = "^069(2|3)([0-9]){6}$";
$EXP_cp = "^974([0-9]){2}$";
$EXP_mail = "^([a-z0-9._-])+@([a-z0-9.-])+(.)([a-z]){2,4}$";
$EXP_nom = "^[a-zA-Zéçèàêëîïôöûüâä�������������'-][a-zA-Zéçèàêëîïôöûüâä�������������' -]{2,50}$";
$EXP_date = "^[0-9]{2}/[0-9]{2}/[0-9]{4}$";
$EXP_url = "^http://";

if(!ereg($EXP_mail, $mail)){ echo "your mail is invalid"; }

?>

Revision: 30528
at September 21, 2010 16:18 by alexandrepayet


Updated Code
<?php

$EXP_num = "^[0-9]+$";
$EXP_num_fixe = "^0262([0-9]){6}$";
$EXP_num_portable = "^069(2|3)([0-9]){6}$";
$EXP_cp = "^974([0-9]){2}$";
$EXP_mail = "^[a-z0-9._-].+@([a-z.-])+(.)([a-z]){2,4}$";
$EXP_nom = "^[a-zA-ZéçèàêëîïôöûüâäÉÀÈËËÏÎÖÔÛÜÄÂ'-][a-zA-ZéçèàêëîïôöûüâäÉÀÈËËÏÎÖÔÛÜÄÂ' -]{2,50}$";
$EXP_date = "^[0-9]{2}/[0-9]{2}/[0-9]{4}$";
$EXP_url = "^http://";

if(!ereg($EXP_mail, $mail)){ echo "your mail is invalid"; }

?>

Revision: 30527
at September 21, 2010 16:18 by alexandrepayet


Updated Code
<?php

$EXP_num = "^[0-9]+$";
$EXP_num_fixe = "^0262([0-9]){6}$";
$EXP_num_portable = "^069(2|3)([0-9]){6}$";
$EXP_cp = "^974([0-9]){2}$";
$EXP_mail = "^[a-z0-9._-].+@([a-z.-])+(.)([a-z]){2,4}$";
$EXP_nom = "^[a-zA-Zéçèàêëîïôöûüâä�������������'-][a-zA-Zéçèàêëîïôöûüâä�������������' -]{2,50}$";
$EXP_date = "^[0-9]{2}/[0-9]{2}/[0-9]{4}$";
$EXP_url = "^http://";

if(!ereg($EXP_mail, $mail)){ echo "your mail is invalid"; }

?>

Revision: 30526
at August 16, 2010 21:43 by alexandrepayet


Initial Code
<?php

$EXP_num = "^[0-9]+$";
$EXP_num_fixe = "^0262([0-9]){6}$";
$EXP_num_portable = "^069(2|3)([0-9]){6}$";
$EXP_cp = "^974([0-9]){2}$";
$EXP_mail = "^[a-z0-9._-].+@([a-z.-])+([.])([a-z]){2,4}$";
$EXP_nom = "^[a-zA-ZéçèàêëîïôöûüâäÉÀÈËËÏÎÖÔÛÜÄÂ'-][a-zA-ZéçèàêëîïôöûüâäÉÀÈËËÏÎÖÔÛÜÄÂ' -]{2,50}$";
$EXP_date = "^[0-9]{2}/[0-9]{2}/[0-9]{4}$";
$EXP_url = "^http://";

if(!ereg($EXP_mail, $mail)){ echo "your mail is invalid"; }

?>

Initial URL

                                

Initial Description

                                

Initial Title
PHP : expressions regulieres les plus courantes et exemple de test avec ereg()

Initial Tags
php

Initial Language
PHP