|
@@ -77,6 +77,14 @@ class Address { |
|
@@ -77,6 +77,14 @@ class Address { |
77
|
* @time 2024/9/11 11:43
|
77
|
* @time 2024/9/11 11:43
|
78
|
*/
|
78
|
*/
|
79
|
private function pregEmail(string $str):string {
|
79
|
private function pregEmail(string $str):string {
|
|
|
80
|
+ $str = trim($str);
|
|
|
81
|
+ if(substr($str,-1) == '>'){
|
|
|
82
|
+ $email = substr($str,strrpos($str,'<'));
|
|
|
83
|
+ if($email){
|
|
|
84
|
+ return trim(str_replace(['<','>'],'',$email));
|
|
|
85
|
+ }
|
|
|
86
|
+ }
|
|
|
87
|
+
|
80
|
preg_match_all('/\w+([-+.]\w+)*@\w+([-.]\w+)*\.\w+([-.]\w+)*/',$str,$email);
|
88
|
preg_match_all('/\w+([-+.]\w+)*@\w+([-.]\w+)*\.\w+([-.]\w+)*/',$str,$email);
|
81
|
if(!empty($email[0])){
|
89
|
if(!empty($email[0])){
|
82
|
$email = end($email[0]);
|
90
|
$email = end($email[0]);
|