$re = '/^#+\s*(.*?)\{#(.*)\}/m';
$str = '# Scoring import {#calculate-score}
Loads Scoring*csv files from the WebDAV and import them locally.
While processing and when finished, the file gets renamed on the WebDAV.
# Response export {#unsubscribe-export}
Exports unsubscribes, bounces and complaints and stores the export files
on an SFTP of the customer.
# Campaign uploader {#15mins-campaign-uploader}
Fetches a ZIP from the customers SFTP.
This ZIP must contain a JSON and a HTML. Images must be stored in a `img`
folder. Size limit for an image is 1 MB. Images will be uploaded to the
Suite media library. Campaign meta data will be read from the JSON.
**This process is currently deactivated**
# ecard invite a friend landing page {#recommendation-form}
A form to invite friends. The friends data will be stored in the Suite account.
# Pretrip form {#pretrip-information-form}
Asking the end user to provide more more data before they arrive.
# Signup pages and preference center {#preference-center}
Pages to subscribe and to manage personal data.';
preg_match_all($re, $str, $matches, PREG_SET_ORDER, 0);
// Print the entire match result
var_dump($matches);
Please keep in mind that these code samples are automatically generated and are not guaranteed to work. If you find any syntax errors, feel free to submit a bug report. For a full regex reference for PHP, please visit: http://php.net/manual/en/ref.pcre.php