2016-11-15 30 views
1

我想結合幾個簡單的電子郵件PCRE正則表達式檢查Postfix。我會說實話,這不是我的專業領域。簡單的電子郵件正則表達式問題

有沒有辦法結合2?還是應該將它們分開?

我知道我需要<>是可選的,但添加?給他們什麼都沒做。

This handles "<[email protected]>, <[email protected]>" format 
(?:To|Cc):(?:.+?<.+?[@].+?>){2,} 

This handles "[email protected], [email protected]" format 
(?:To|Cc):(?:.+?[@].+?),.{2,} 

任何幫助將不勝感激。

回答