package main
import (
"regexp"
"fmt"
)
func main() {
var re = regexp.MustCompile(`(?:(\[[a-zA-Z]+.*?\/?\].*?\[\/[a-zA-Z]+.*?\/?\]))`)
var str = `Now I know what you're thinking, "fish and chips in France? What?" but it's true! Over the Christmas holidays, I was lucky enough to be taken to a fish and chips restaurant, owned by retired rugby player Johnny Howard. Johnny moved to France a few years ago, and once he retired from the sport, he decided to open his very own restaurant. Now, if you're looking to get your hands on the most mouth watering fish and chips you've ever tasted in your life, then get yourself down there on a Friday, and you can have your pick of delicious starters, main meals and desserts.<!--more-->
[caption id="attachment_1193" align="aligncenter" width="500"]<a href="http://www.southfranceholidayvillas.co.uk/blog/wp-content/uploads/2014/01/Fish-n-chips-21.jpg"><img class=" wp-image-1193 " alt="La Charnière, Bar, Restaurant" src="http://www.southfranceholidayvillas.co.uk/blog/wp-content/uploads/2014/01/Fish-n-chips-21-1024x768.jpg" width="500" height="374" /></a> A view of the upstairs bar.[/caption]
La Charnière is open all week and serves fish and chips, mushy peas and tartare sauce on Fridays . There is a variety of delicious foods and drinks that you can enjoy there, as well as a lemon beer that my family never fails to order, delicious!
Johnny Howard is an absolutely lovely Englishman who runs the restaurant with his French wife and a couple of other friendly employees. There is a really nice vibe at La Charnière as Johnny often comes over to say hi and have a chat. The restaurant is often full of English people, who are all very friendly and enjoy meeting new people, the atmosphere is great!
[caption id="attachment_1195" align="aligncenter" width="500"]<a href="http://www.southfranceholidayvillas.co.uk/blog/wp-content/uploads/2014/01/Fish-n-chips-31.jpg"><img class=" wp-image-1195 " alt="La Charniere, restaurant" src="http://www.southfranceholidayvillas.co.uk/blog/wp-content/uploads/2014/01/Fish-n-chips-31-768x1024.jpg" width="500" height="666" /></a> A view of the upstairs restaurant.[/caption]
There is also a bar downstairs which opens in the evenings. Johnny's restaurant is often full to the brim on rugby game days, as he has a big screen in the bar and in the restaurant, it is definitely worth seeing and the atmosphere on those days is fantastic!
[caption id="attachment_1196" align="aligncenter" width="500"]<a href="http://www.southfranceholidayvillas.co.uk/blog/wp-content/uploads/2014/01/Fish-and-chips-1.jpg"><img class=" wp-image-1196 " alt="The downstairs bar is very rustic yet lively. It's a great place to go to on a night out!" src="http://www.southfranceholidayvillas.co.uk/blog/wp-content/uploads/2014/01/Fish-and-chips-1-1024x768.jpg" width="500" height="374" /></a> The downstairs bar is very rustic yet lively. It's a great place to go to on a night out![/caption]
`
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/