<?php
$message = '
You have ordered our Undergraduate Prospectus 2015 entry.
<ul>
<li>Download the Undergraduate Prospectus 2015 entry (XXMB). You will need to choose save when prompted.</li>
</ul>
<br />
If you are having difficulty downloading the file onto your device you can also <a href="http://www3.imperial.ac.uk/ugprospectus?utm_source=ProspReqUGAck&utm_medium=Email&utm_content=ugprospectuspage&utm_campaign=CRMCommsMRA">find information about studying at Imperial online</a>.<br />
<br />
A copy of the prospectus will also be sent out to the address you have provided. <br />
<br />
[xxxStudent.address_1xxx][xxxStudent.address_2xxx][xxxStudent.address_3xxx]<br />
[xxxStudent.townxxx]<br />
[xxxStudent.countyxxx]<br />
[xxxStudent.postcodexxx]<br />
[xxxStudent.country_iso_2xxx]<br />
<br />
Please allow up to five working days for delivery (UK) or up to three weeks for overseas addresses.<br />
<br />
While you are waiting for your prospectus to arrive, you can go online to find out more about life at Imperial and opportunities to come and visit the College.<br />
<br />
For information about tuition fees and financial support please see our s<a href="http://www3.imperial.ac.uk/studentfinance?utm_source=ProspReqUGAck&utm_medium=Email&utm_content=studentfinance&utm_campaign=CRMCommsMRA">tudent finance webpages</a>. <br />
Visit us on campus <a href="http://www3.imperial.ac.uk/visit?utm_source=ProspReqUGAck&utm_medium=Email&utm_content=campusvisit&utm_campaign=CRMCommsMRA">by registering for an Open Day or campus tour</a>.<br />
Information about Student Accommodation can be found <a href="http://www3.imperial.ac.uk/accommodation/prospectivestudents?utm_source=ProspReqUGAck&utm_medium=Email&utm_content=accommodation&utm_campaign=CRMCommsMRA">here on our accommodation website</a>.';
preg_match_all('/\[xxx(\w+[\.+\w+]+)xxx\]/', $message, $tags, PREG_SET_ORDER);
var_dump($tags);