PHP email Email/^[a-z] ([a-z0-9]*[-_]?[ a-z0-9]+) *@ ([a-z0-9]*[-_]?[ a-z0-9]+) +[\.] [A-z] {2,3} ([\.] [A-z] {2})? $/i;/i form a case-insensitive regular expression; ^ match start $ match end * represents 0 or more. + represents 1 or more.? Represents 0 or 1. [A-z] The e-mail prefix must be preceded by an English letter ([a-z0-9]*[-_]?[ a-z0-9]+) * and _a_2, AAA11, _1_a_2 match, and A1_, Aaff_33a_, A__aa do not match, if it is a null character, is also matched, [a-z0-9]* match 0 or more English letters or numbers [-_]? Match 0 or 1 "-" because "-" cannot appear consecutively [a-z0-9]+ matches 1 or more English letters or numbers, because "-" cannot be the end @ must have a @ ([a-z0-9]*[-_]?[ a-z0-9]+) + See above ([a-z0-9]*[-_]?[ a-z0-9]+) * explanation, but cannot be empty, + denotes one or more. [\.] The special character (.) As a normal character [a-z]{2,3} matches 2 to 3 English letters, usually COM or net, and so on. ([\.] [A-z] {2})? Match 0 or 1 [\.] [A-z] {2} (e.g.. CN, etc.) I don't know the general. Com.cn the last part is not all two-bit, if not please modify {2} to {start Word, end Word} <?phpfunction Getemail ($str) {$pattern = "/([a-z0-9]*[- _\.]? [a-z0-9]+] *@ ([a-z0-9]*[-_]?[ a-z0-9]+) +[\.] [A-z] {2,3} ([\.] [A-z] {2})? /i ";p reg_match_all ($pattern, $str, $EMAILARR); return $EMAILARR [0];} $emailstr = "[email protected] I am not a M VI place to open the IID mailing list: [email protected] and [email protected];. ;;, [email protected],[email protected] "; $emailArr = Getemail ($EMAILSTR); echo" <pre> ";p Rint_r ($EMAILARR); echo "</pre>";? >