File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -39,7 +39,8 @@ abstract class ContactsEncoder
3939 * Regular expressions parts.
4040 */
4141 const ARIA_LABEL_PATTERN = '/aria-label.?=.?[ \'"].+?[ \'"]/ ' ;
42- const EMAIL_PATTERN = '[_A-Za-z0-9-\.]+@[_A-Za-z0-9-\.]+\.[A-Za-z]{2,} ' ;
42+ const EMAIL_PATTERN = '[_A-Za-z0-9-\.]+@[_A-Za-z0-9-\.]+\.[A-Za-z]{2,}\b ' ;
43+ const EMAIL_PATTERN_DOMAIN_CATCHING = '[_A-Za-z0-9-\.]+@[_A-Za-z0-9-\.]+(\.[A-Za-z]{2,}\b) ' ;
4344 const PHONE_NUMBER = '\+\d{8,12} ' ;
4445 const PHONE_NUMBERS_PATTERNS = [
4546 '(tel: ' . self ::PHONE_NUMBER . ') ' , // tel:+XXXXXXXXXX
@@ -194,7 +195,7 @@ private function prepareRegularExpressions()
194195 {
195196 $ this ->aria_regex = self ::ARIA_LABEL_PATTERN ;
196197
197- $ this ->global_email_pattern = '/(mailto\:\b ' . self ::EMAIL_PATTERN . '\b )|(\b ' . self ::EMAIL_PATTERN . '\b )/ ' ;
198+ $ this ->global_email_pattern = '/(mailto\:\b ' . self ::EMAIL_PATTERN . ')|(\b ' . self ::EMAIL_PATTERN_DOMAIN_CATCHING . ')/ ' ;
198199 $ this ->global_phones_pattern = '/ ' . implode ('| ' , self ::PHONE_NUMBERS_PATTERNS ) . '/ ' ;
199200 $ this ->global_mailto_pattern = '/mailto\:( ' . self ::EMAIL_PATTERN . ')/ ' ;
200201 $ this ->plain_email_pattern = '/(\b ' . self ::EMAIL_PATTERN . '\b)/ ' ;
You can’t perform that action at this time.
0 commit comments