package main
import (
"fmt"
"regexp"
)
func main() {
html := "{{test}}ing <if>abc</if> {{test}} <if>123</if>"
key := "test"
html = regexp.MustCompile("{{"+key+"}}").ReplaceAllString(html, key)
array_temp := regexp.MustCompile("<if>(.*?)</if>").FindAllStringSubmatch(html, -1)
var if_array []string
for _, val := range array_temp {
if_array = append(if_array, val[1])
}
fmt.Println(html)
fmt.Println(if_array)
}