0

How I can find multiple value in brackets?

package main

import (
    "fmt"
    "regexp"
)

func main() {
    re := regexp.MustCompile(`\{[A-Za-z0-9]*\}`)
    s := "{tag1} SomeText {tag2}"
    fmt.Println(re.FindStringSubmatch(s))
}

This code return only first tag tag1.

https://play.golang.org/p/T8lhGpzfOBj

0 Answers0