God, I never really worked with regex, but I figured out whats wrong. You need to add / one at the beginning and one at the end. Like this
PHP Code:
function valid_email($address) {
if (preg_match('/^[a-zA-Z0-9_\.\-]+@[a-zA-Z0-9\-]+\.[a-zA-Z0-9\-\.]+$/', $address)) return true;
else return false;
}
old
'^[a-zA-Z0-9_\.\-]+@[a-zA-Z0-9\-]+\.[a-zA-Z0-9\-\.]+$'
new
'
/^[a-zA-Z0-9_\.\-]+@[a-zA-Z0-9\-]+\.[a-zA-Z0-9\-\.]+$
/'