I am just learning regular expressions and need help creating one.
I have a form and I want to make sure that the data sent to the processing script contains only the email of the actual submitter of the form. No other email addresses should be present in the data.
What is the regular expression ($str_emailcheck below) for preg_match that I would use to make sure no other email address exists within the data?
$submitter_name = $_POST['Name'];
$submitter_email = $_POST['Email'];
$submitter_notes = $_POST['Notes'];
$complete_dataset = $submitter_name.'\r\n'.$submitter_email.'\r\n'.$submitter_notes;
// only $submitter_email above must be included in $complete_dataset
// no other email address can be included
$str_emailcheck = '';
$emailcheck = preg_match($str_emailcheck, $complete_dataset, $matches);