I have a code: <?php if (eregi("[.0-9a-z-]+@([0-9a-z][0-9a-z-]+.)+[a-z]{2,3}$",$email)) { echo "you have passed Email"; } ?> But I don't know "" and "$" in " eregi("[.0-9a-z-]+@([0-9a-z][0-9a-z-]+.)+[a-z]{2,3}$",$email) " Can you give me a explain?
^ matches the beginning of the string; $ the end. Thus your regex matches the entire string, not just a substring.