package main
import (
"regexp"
"fmt"
)
func main() {
var re = regexp.MustCompile(`(?m)^#+\s*(.*?)\{#(.*)\}`)
var 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.`
for i, match := range re.FindAllString(str, -1) {
fmt.Println(match, "found at index", i)
}
}
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 Golang, please visit: https://golang.org/pkg/regexp/