You are here

public function SocialBulkGroupInvitation::extractEmailsFrom in Open Social 8.9

Same name and namespace in other branches
  1. 10.3.x modules/social_features/social_group/modules/social_group_invite/src/Form/SocialBulkGroupInvitation.php \Drupal\social_group_invite\Form\SocialBulkGroupInvitation::extractEmailsFrom()
  2. 10.0.x modules/social_features/social_group/modules/social_group_invite/src/Form/SocialBulkGroupInvitation.php \Drupal\social_group_invite\Form\SocialBulkGroupInvitation::extractEmailsFrom()
  3. 10.1.x modules/social_features/social_group/modules/social_group_invite/src/Form/SocialBulkGroupInvitation.php \Drupal\social_group_invite\Form\SocialBulkGroupInvitation::extractEmailsFrom()
  4. 10.2.x modules/social_features/social_group/modules/social_group_invite/src/Form/SocialBulkGroupInvitation.php \Drupal\social_group_invite\Form\SocialBulkGroupInvitation::extractEmailsFrom()

Custom function to extract email addresses from a string.

2 calls to SocialBulkGroupInvitation::extractEmailsFrom()
SocialBulkGroupInvitation::submitForm in modules/social_features/social_group/modules/social_group_invite/src/Form/SocialBulkGroupInvitation.php
Custom form submit.
SocialBulkGroupInvitation::validateForm in modules/social_features/social_group/modules/social_group_invite/src/Form/SocialBulkGroupInvitation.php
Custom form validation.

File

modules/social_features/social_group/modules/social_group_invite/src/Form/SocialBulkGroupInvitation.php, line 432

Class

SocialBulkGroupInvitation
Class SocialBulkGroupInvitation.

Namespace

Drupal\social_group_invite\Form

Code

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];
}