package main
import (
"regexp"
"fmt"
)
func main() {
var re = regexp.MustCompile(`(?m)(;)?(?:^| +)([\d.]+)[ A-Z\/\d]+`)
var str = `2 MG/ML
500 MCG
100 MG ; 200 MG ; 200 MCG
100 MCG/ML
325 MG ; 37.5 MG
60 G ; 9 G/1000 ML`
var substitution = "$1$2"
fmt.Println(re.ReplaceAllString(str, substitution))
}
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/