package main
import (
"regexp"
"fmt"
)
func main() {
var re = regexp.MustCompile(`(?i)\[img.*\].*photobucket.*(.jpg)\[\/img.*\]`)
var str = `Connecting rod fitted to prevent steering tie rod from cranking:
[url=http://s557.photobucket.com/user/realboss7669/media/F707F408-829F-48B9-9AED-BB57CEFF96C0_zpslwioah0z.jpg.html:jaeyh8wg][img:jaeyh8wg]http://i557.photobucket.com/albums/ss16/realboss7669/F707F408-829F-48B9-9AED-BB57CEFF96C0_zpslwioah0z.jpg[/img:jaeyh8wg][/url:jaeyh8wg]
From the rear:
[url=http://s557.photobucket.com/user/realboss7669/media/05AE0DB2-83FD-4B2C-9FDA-E3257DFEB832_zpsc6cfuqwi.jpg.html:jaeyh8wg][img:jaeyh8wg]http://i557.photobucket.com/albums/ss16/realboss7669/05AE0DB2-83FD-4B2C-9FDA-E3257DFEB832_zpsc6cfuqwi.jpg~original[/img:jaeyh8wg][/url:jaeyh8wg]
Steering damper mounts finished - without the connecting rod the damper would get bent:
[url=http://s557.photobucket.com/user/realboss7669/media/C85A0F5D-413D-4779-9F09-BD43BB798238_zpse8s6dxyu.jpg.html:jaeyh8wg][img:jaeyh8wg]http://i557.photobucket.com/albums/ss16/realboss7669/C85A0F5D-413D-4779-9F09-BD43BB798238_zpse8s6dxyu.jpg[/img:jaeyh8wg][/url:jaeyh8wg]
<!-- s8) --><img src="{SMILIES_PATH}/icon_cool.gif" alt="8)" title="Cool" /><!-- s8) -->`
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/