ereg() - Regular expression match

Information for PHP. Hypertext Preprocessor
Post Reply
Posts: 94
Joined: Sun Mar 01, 2015 4:36 am

ereg() - Regular expression match

Post by dzcadii » Sun Mar 01, 2015 6:29 pm

Yes i know right from the manual; but simpler!

The function is ereg();

int ereg ( string $pattern , string $string [, array &$regs ] )
Searches a string for matches to the regular expression given in pattern in a case-sensitive way.

If you want to see ereg(); for JavaScript viewtopic.php?f=20&t=53
^#(^ **NOT the same (string content can be the same but function/object/method call is different ( -->"RegExp()"))** ^#(^

Code: Select all

$email_address = "";

Email address patterns accepted:(.com,.net,.edu.,.mil,.gov, etc)


$email_address+pattern = "^[a-zA-Z0-9_\.]{2,}@{1}(([a-zA-z]{2,}\.{1}[a-zA-Z]{2,6})|([a-zA-Z]{2,}\.{1}[a-zA-Z]{2,}\.[a-zA-Z]{2,6})|([a-zA-Z]{2,}\.{1}[a-zA-Z]{2,}\.[a-zA-Z]{2,}\.[a-zA-Z]{2,6}))$";


Post Reply