package main
import (
"regexp"
"fmt"
)
func main() {
var re = regexp.MustCompile(`_(.*?)(?=\\)`)
var str = `{\"header\":[[{\"colspan\":\"1\",\"rowspan\":\"1\",\"content\":[{\"sourceType\":\"text\",\"text\":\"<p>Opportunity<\\/p>\",\"type\":\"Paragraph\"}]},{\"colspan\":\"1\",\"rowspan\":\"1\",\"content\":[{\"sourceType\":\"text\",\"text\":\"<p>Date<\\/p>\",\"type\":\"Paragraph\"}]},{\"colspan\":\"1\",\"rowspan\":\"1\",\"content\":[{\"sourceType\":\"text\",\"text\":\"<p>Launch Vehicle<\\/p>\",\"type\":\"Paragraph\"}]},{\"colspan\":\"1\",\"rowspan\":\"1\",\"content\":[{\"sourceType\":\"text\",\"text\":\"<p>Excess Capacity<\\/p>\",\"type\":\"Paragraph\"}]},{\"colspan\":\"1\",\"rowspan\":\"1\",\"content\":[{\"sourceType\":\"text\",\"text\":\"<p>Orbit<\\/p>\",\"type\":\"Paragraph\"}]},{\"colspan\":\"1\",\"rowspan\":\"1\",\"content\":[{\"sourceType\":\"text\",\"text\":\"<p>Cost<\\/p>\",\"type\":\"Paragraph\"}]}]],\"style\":\"normal\",\"body\":[[{\"colspan\":\"1\",\"rowspan\":\"1\",\"content\":[{\"sourceType\":\"reference\",\"sourceProperty\":\"name\",\"source\":\"_18_0_2_f280366_1447380313181_755886_144674\",\"type\":\"Paragraph\"}]},{\"colspan\":\"1\",\"rowspan\":\"1\",\"content\":[{\"sourceType\":\"reference\",\"sourceProperty\":\"value\",\"source\":\"_18_0_2_f280366_1447380432770_58741_154478\",\"type\":\"Paragraph\"}]},{\"colspan\":\"1\",\"rowspan\":\"1\",\"content\":[{\"sourceType\":\"reference\",\"sourceProperty\":\"value\",\"source\":\"_18_0_2_f280366_1447380396246_873072_144853\",\"type\":\"Paragraph\"}]},{\"colspan\":\"1\",\"rowspan\":\"1\",\"content\":[{\"sourceType\":\"reference\",\"sourceProperty\":\"value\",\"source\":\"_18_0_2_f280366_1447380432768_736282_154472\",\"type\":\"Paragraph\"}]},{\"colspan\":\"1\",\"rowspan\":\"1\",\"content\":[{\"sourceType\":\"reference\",\"sourceProperty\":\"value\",\"source\":\"_18_0_2_f280366_1447380395593_804641_144677\",\"type\":\"Paragraph\"}]},{\"colspan\":\"1\",\"rowspan\":\"1\",\"content\":[{\"sourceType\":\"reference\",\"sourceProperty\":\"value\",\"source\":\"_18_0_2_f280366_1447380433550_448862_154654\",\"type\":\"Paragraph\"}]}]],\"title\":\"Possible Rideshares\",\"type\":\"Table\"}
IShouldGet3Match,allTheSequenceBetweenaUnderScoreAndASlashHere'sOne:_1234_1234\andheresAnother_1234_1234_1234\OhLookAnotherOne!_123_12_1234567\bahbahba
`
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/