I want to create a regular expression for below string. The dynamic portion (i.e. for which expression needed is in bold text)
The mail system
**email address**: host mx2.hotmail.com[65.55.92.152] said:
550 Requested action not taken:
**mailbox unavailable** (in reply to RCPTTO command)
Basically I want that my regexp search for email and the "mailbox unavailable".
So it will search for mail first and then search for the string "mailbox unavailable".
How can I do this? I need to use preg_match php function for this.
Edit:
Actually I am doing code to find the bounced mail. I am placing the source code of the full email to match. one of my email giving above error. So I need to check for that error contain in email code or not. If that code found then it will return error accordingly. So in that error message dynamic parts are email address, ip in square brackets and the string mailbox unavailable.