package main
import (
"regexp"
"fmt"
)
func main() {
var re = regexp.MustCompile(`(?i)(creatinine).*?(\d+)\D*(\d+\s*-\s*\d+)?`)
var str = `TEST RESULT\.br\COLLECTION DATE 6-FEB-2014\.br\24 HOUR URINE VOLUME 0.100\.br\\.br\SERUM CREATININE LEVEL 511 HI 64 - 110`
if len(re.FindStringIndex(str)) > 0 {
fmt.Println(re.FindString(str),"found at index",re.FindStringIndex(str)[0])
}
}
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/