public function InviteEmailBaseForm::extractEmailsFrom in Open Social 10.1.x
Same name and namespace in other branches
- 8.9 modules/social_features/social_core/src/Form/InviteEmailBaseForm.php \Drupal\social_core\Form\InviteEmailBaseForm::extractEmailsFrom()
- 10.3.x modules/social_features/social_core/src/Form/InviteEmailBaseForm.php \Drupal\social_core\Form\InviteEmailBaseForm::extractEmailsFrom()
- 10.0.x modules/social_features/social_core/src/Form/InviteEmailBaseForm.php \Drupal\social_core\Form\InviteEmailBaseForm::extractEmailsFrom()
- 10.2.x modules/social_features/social_core/src/Form/InviteEmailBaseForm.php \Drupal\social_core\Form\InviteEmailBaseForm::extractEmailsFrom()
Custom function to extract email addresses from a string.
1 call to InviteEmailBaseForm::extractEmailsFrom()
- EnrollInviteEmailForm::validateForm in modules/
social_features/ social_event/ modules/ social_event_invite/ src/ Form/ EnrollInviteEmailForm.php - Form validation handler.
File
- modules/
social_features/ social_core/ src/ Form/ InviteEmailBaseForm.php, line 136
Class
- InviteEmailBaseForm
- Class InviteBaseForm.
Namespace
Drupal\social_core\FormCode
public function extractEmailsFrom($string) {
// Remove select2 ID parameter.
$string = str_replace('$ID:', '', $string);
preg_match_all("/[\\._a-zA-Z0-9+-]+@[\\._a-zA-Z0-9+-]+/i", $string, $matches);
return $matches[0];
}