regular.thumbnail

Php regular expression to validate an email address

$email = 'sajithmr2005@yahoo.com'; if (eregi("^[a-z0-9-]+(.[a-z0-9-]+)@[a-z0-9-]+(.[a-z0-9-]+)(.[a-z]{2,3})$", $email)) { echo 'valid email' ; } ?> //Regular Expression for Validate a number $mobile = '9846831106'; if ( ereg('^[[:digit:]]+$', $mobile) ) { echo 'valid number'; } ?>

Regular Expression for Removing non-alphabetic characters from a string or a Filename.

$newFilename = preg_replace(“/[^a-zA-Z0-9s.]/”, “”, $newFilename);