package main
import (
"regexp"
"fmt"
)
func main() {
var re = regexp.MustCompile(`(?m)(\S)(,)(\S)`)
var str = `SELECT tbl_Generic_Tool.Generic_Type_ID, tbl_ref_Generic_Type.Generic_Type,
tbl_Hex.ODD_Micap,tbl_Hex.Hex_ID,tbl_Hex.Hex_No ,Min(tbl_ref_Phase.Phase) AS FirstOfPhase,tbl_ref_Building.Building_Abbrev,tbl_ref_Status_Equipment.Status_Equipment
GROUP BY
tbl_Generic_Tool.Generic_Type_ID,tbl_ref_Generic_Type.Generic_Type,tbl_Hex.ODD_Micap,tbl_Hex.Hex_ID,tbl_Hex.Hex_No,tbl_ref_Building.Building_Abbrev,tbl_Hex.Status_Equipment_ID,tbl_ref_Status_Equipment.Status_Equipment
HAVING
(((tbl_Hex.ODD_Micap) < CONVERT(DATE,GETDATE()))
AND ((tbl_Hex.Status_Equipment_ID) = 2)))¦ AS H
LEFT JOIN tbl_POC_Assigned ON H.Hex_ID = tbl_POC_Assigned.Hex_ID
GROUP BY
H.Generic_Type
,H.Building_Abbrev
,H.ODD_Micap
,H.Hex_ID
,H.Hex_No
,H.Status_Equipment`
var substitution = "\1\2 \3"
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/